public class AcquisitionQueue extends Queue implements AcquisitionQueueMBean
AcquisitionQueue
class implements the MOM acquisition queue
behavior, basically acquiring messages periodically or on client request,
using an AcquisitionModule
.Queue.QueueFactory
Modifier and Type | Field and Description |
---|---|
private String |
ACQ_QUEUE_MAX_MSG |
private String |
ACQ_QUEUE_MAX_PND |
private String |
ACQ_QUEUE_MIN_MSG |
private String |
ACQ_QUEUE_MIN_PND |
private String |
acquisitionClassName
The acquisition class name.
|
private AcquisitionModule |
acquisitionModule
The acquisition module.
|
private long |
acquisitionNotNb |
private long |
diff_max
The threshold of messages send by the handler in the engine
|
private long |
diff_min |
private String |
lastMessageId
Stores the id of the last message received to avoid duplicates.
|
static org.objectweb.util.monolog.api.Logger |
logger |
private long |
msgCount
The number of produced messages.
|
private boolean |
pause |
private long |
pending_max
The threshold of pending messages in the queue
|
private long |
pending_min |
private Properties |
properties
Stores the last set of properties defined.
|
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
ARRIVAL_STATE_PREFIX, arrivalState, cload, defaultDMQId, defaultRedeliveryDelay, defaultThreshold, DELIVERY_TABLE_PREFIX, DELIVERY_TIME_TABLE_PREFIX, deliveryTable, deliveryTimeTable, hcons, hprod, logmsg, messages, msgTxPrefix, msgTxPrefixLength, nbMaxMsg, nbMsgsDeniedSinceCreation, pload, receiving, REDELIVERY_DELAY, requests
_rights, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, task, WAKEUP_PERIOD, WRITE
agentProfiling, emptyString, fixed, logmon
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
Constructor and Description |
---|
AcquisitionQueue() |
Modifier and Type | Method and Description |
---|---|
private void |
acquisitionNot(AcquisitionNot not)
This method process messages from the acquisition module.
|
void |
agentFinalize(boolean lastTime)
Finalizes the agent before it is garbaged.
|
private void |
close() |
long |
getAcquiredMsgCount()
Returns the number of messages acquired by the acquisition handler.
|
String |
getAcquisitionClassName()
Returns the acquisition handler class name.
|
long |
getAcquisitionPeriod()
Returns the acquisition period.
|
long |
getDiffMax()
Returns the maximum number of acquired messages waiting to be handled by
the destination.
|
long |
getDiffMin()
Returns the minimum threshold of acquired messages waiting to be handled by
the destination for restarting the acquisition handler.
|
int |
getEncodableClassId()
Enables the sub classes not to implement this method.
|
long |
getExpiration()
Returns the expiration value for produced messages.
|
long |
getHandledMsgCount()
Returns the number of acquired messages processed by the destination.
|
long |
getPendingMax()
Returns the maximum number of waiting messages in the destination.
|
long |
getPendingMin()
Returns the minimum threshold of waiting messages in the destination for restarting
the acquisition handler.
|
int |
getPriority()
Returns the priority of produced messages.
|
void |
initialize(boolean firstTime)
Initializes the destination.
|
boolean |
isMessagePersistent()
Returns true if the messages produced are persistent.
|
ClientMessages |
preProcess(AgentId from,
ClientMessages cm)
Incoming JMS messages are processed by the acquisition module
and a null ClientMessages is always returned to the base
implementation.
|
void |
react(AgentId from,
Notification not)
Distributes the received notifications to the appropriate reactions.
|
void |
setExpiration(long expiration)
Sets the expiration value for produced messages.
|
void |
setMessagePersistent(boolean isPersistent)
Sets the DeliveryMode value for the produced messages.
|
void |
setPriority(int priority)
Sets the priority of produced messages.
|
void |
setProperties(Properties properties,
boolean firstTime)
Configures an
AcquisitionQueue instance. |
protected Properties |
startHandler(Properties prop)
Start the handler.
|
protected Properties |
stopHandler(Properties prop)
Stop the handler.
|
String |
toString()
Returns a string representation of this destination.
|
abortReceiveRequest, acknowledgeRequest, addClientMessages, addDeliveryTimeMessage, addMessage, agentSave, browseRequest, checkDelivery, cleanPendingMessage, cleanPendingMessage, cleanWaitingRequest, cleanWaitingRequest, decode, deliverMessages, denyRequest, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, encode, finalize, getClientMessages, getConsumerLoad, getDefaultDMQId, getDefaultRedeliveryDelay, getDefaultThreshold, getDeliveredMessageCount, getDeliveryTimeMessageCount, getEncodedSize, getMessage, getMessages, getMessagesView, getMsgTxPrefix, getNbMaxMsg, getNbMsgsDeliverSinceCreation, getNbMsgsDeniedSinceCreation, getNbMsgsReceiveSinceCreation, getPendingMessageCount, getProducerLoad, getQueueMessage, getRedeliveryDelay, getStats, getThreshold, getType, getWaitingRequestCount, handleAdminRequestNot, handleExpiredNot, isSyncExceptionOnFullDest, isUndeliverable, isValidJMXAttribute, messageDelivered, messageRemoved, processDeliveryTime, receiveRequest, removeMessages, setDefaultRedeliveryDelay, setMsgTxName, setNbMaxMsg, setRedeliveryDelay, setSyncExceptionOnFullDest, setThreshold, storeMessage, storeMessageHeader, wakeUpNot
agentInitialize, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getJMXStatistics, getMBeanName, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, interceptorsAvailable, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isWriter, postProcess, processAdminCommand, processInterceptors, processSetRight, processStartHandler, processStopHandler, replyToTopic, requestGroupNot, setAdminId, setFreeReading, setFreeWriting, setPeriod, setRight, unknownAgent
delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, isAgentProfiling, isDeployed, isFixed, isUpdated, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cleanPendingMessage, cleanWaitingRequest, getConsumerLoad, getDeliveredMessageCount, getMessage, getMessages, getMessagesView, getNbMaxMsg, getNbMsgsDeniedSinceCreation, getPendingMessageCount, getProducerLoad, getRedeliveryDelay, getThreshold, getWaitingRequestCount, setNbMaxMsg, setRedeliveryDelay, setThreshold
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
getAgentId, getCommitTime, getReactNb, getReactTime, isAgentProfiling, isFixed, resetCommitTime, resetReactTime, resetTimer, setAgentProfiling
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
private transient AcquisitionModule acquisitionModule
private Properties properties
private String lastMessageId
private long msgCount
private long diff_max
private long diff_min
private String ACQ_QUEUE_MAX_MSG
private String ACQ_QUEUE_MIN_MSG
private long pending_max
private long pending_min
private String ACQ_QUEUE_MAX_PND
private String ACQ_QUEUE_MIN_PND
private boolean pause
private String acquisitionClassName
private transient long acquisitionNotNb
public final long getHandledMsgCount()
getHandledMsgCount
in interface AcquisitionQueueMBean
public final long getDiffMax()
A value lesser or equal to 0 disables the mechanism.
getDiffMax
in interface AcquisitionQueueMBean
public final long getDiffMin()
getDiffMin
in interface AcquisitionQueueMBean
public final long getPendingMax()
A value lesser or equal to 0 disables the mechanism.
getPendingMax
in interface AcquisitionQueueMBean
public final long getPendingMin()
getPendingMin
in interface AcquisitionQueueMBean
public String getAcquisitionClassName()
AcquisitionMBean
getAcquisitionClassName
in interface AcquisitionMBean
public void setProperties(Properties properties, boolean firstTime) throws Exception
AcquisitionQueue
instance.setProperties
in class Queue
properties
- The initial set of properties.Exception
public void initialize(boolean firstTime) throws Exception
Queue
initialize
in class Queue
firstTime
- true when first called by the factoryException
public final long getAcquiredMsgCount()
getAcquiredMsgCount
in interface AcquisitionQueueMBean
public void react(AgentId from, Notification not) throws Exception
Queue
public void agentFinalize(boolean lastTime)
Destination
agentFinalize
in class Destination
lastTime
- true when last called by the factory on agent deletion.public ClientMessages preProcess(AgentId from, ClientMessages cm)
preProcess
in class Destination
from
- The sender of the messagecm
- The incoming messages.AcquisitionModule.processMessages(ClientMessages)
,
Destination.preProcess(AgentId, ClientMessages)
protected Properties startHandler(Properties prop) throws Exception
prop
- properties for start if neededException
protected Properties stopHandler(Properties prop) throws Exception
prop
- properties for stop if neededException
private void acquisitionNot(AcquisitionNot not)
not
- public String toString()
Queue
toString
in interface AgentMBean
toString
in interface DestinationMBean
toString
in class Queue
public long getExpiration()
AcquisitionMBean
getExpiration
in interface AcquisitionMBean
public int getPriority()
AcquisitionMBean
getPriority
in interface AcquisitionMBean
public boolean isMessagePersistent()
AcquisitionMBean
isMessagePersistent
in interface AcquisitionMBean
public void setExpiration(long expiration)
AcquisitionMBean
setExpiration
in interface AcquisitionMBean
expiration
- the expiration to set.public void setMessagePersistent(boolean isPersistent)
AcquisitionMBean
setMessagePersistent
in interface AcquisitionMBean
isPersistent
- if true the messages produced are persistent.public void setPriority(int priority)
AcquisitionMBean
setPriority
in interface AcquisitionMBean
priority
- the priority to set.private void close()
public long getAcquisitionPeriod()
AcquisitionMBean
getAcquisitionPeriod
in interface AcquisitionMBean
public int getEncodableClassId()
Agent
getEncodableClassId
in interface Encodable
getEncodableClassId
in class Queue
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.