Package org.objectweb.joram.mom.dest
Class DistributionQueue
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- org.objectweb.joram.mom.dest.Destination
-
- org.objectweb.joram.mom.dest.Queue
-
- org.objectweb.joram.mom.dest.DistributionQueue
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable,DestinationMBean,DistributionQueueMBean,QueueMBean
public class DistributionQueue extends Queue implements DistributionQueueMBean
TheDistributionQueueclass implements the MOM distribution queue behavior, delivering messages via theDistributionModule.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.objectweb.joram.mom.dest.Queue
Queue.QueueFactory
-
-
Field Summary
Fields Modifier and Type Field Description private booleanbatchDistributionTells if we try to distribute the each message each time (true) or if the distribution is stopped on first error (false).private static booleanDEBUGstatic longDEFAULT_PERIODDefault period used to clean queue and re-distribute failing messages.private StringdistributionClassNameThe acquisition class name.private DistributionDaemondistributionDaemonprivate DistributionModuledistributionModuleprivate booleanisAsyncDistributionTells if daemon distribution is active.private static Loggerloggerprotected longnbMsgsReceiveSinceCreationprivate Propertiespropertiesprivate static longserialVersionUIDdefine serialVersionUID for interoperability-
Fields inherited from class org.objectweb.joram.mom.dest.Queue
ARRIVAL_STATE_PREFIX, arrivalState, cload, defaultDMQId, defaultRedeliveryDelay, defaultThreshold, delayed, DELIVERY_TABLE_PREFIX, DELIVERY_TIMEOUT, deliveryTable, hcons, hprod, LENIENT_REDELIVERY_DELAY, LENIENT_UNDELIVERABLE, logmsg, messages, msgTxPrefix, msgTxPrefixLength, nbExpirations, nbMaxMsg, nbMsgsDeniedSinceCreation, pload, receiving, requests
-
Fields inherited from class org.objectweb.joram.mom.dest.Destination
clients, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, strictCounters, task, temporary, WRITE
-
Fields inherited from class fr.dyade.aaa.agent.Agent
agentProfiling, emptyString, fixed, logmon
-
Fields inherited from interface fr.dyade.aaa.common.encoding.Encodable
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
-
-
Constructor Summary
Constructors Constructor Description DistributionQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidagentFinalize(boolean lastTime)Finalizes the agent before it is garbaged.StringdumpProperties()intgetEncodableClassId()Enables the sub classes not to implement this method.longgetNbMsgsDeliverSinceCreation()Returns the number of messages delivered since creation time of this destination.longgetNbMsgsReceiveSinceCreation()Returns the number of messages received since creation time of this destination.voidinitialize(boolean firstTime)Initializes the destination.private booleanisAsyncDistribution(Properties properties)protected voidpostProcess(ClientMessages cm)This method is needed to add processing after the standard handling.ClientMessagespreProcess(AgentId from, ClientMessages cm)This method is needed to add processing before the standard handling.protected voidprocessSetRight(AgentId user, int right)set user right.private voidremoveAndDeleteMessage(String id)private voidremoveAndDeleteMessages()voidsetProperties(Properties properties, boolean firstTime)Configures aDistributionQueueinstance.StringtoString()Returns a string representation of this destination.voidwakeUpNot(WakeUpNot not)wake up, and cleans the queue.-
Methods inherited from class org.objectweb.joram.mom.dest.Queue
abortReceiveRequest, acknowledgeRequest, addClientMessages, addDeliveryTimeMessage, addMessage, agentSave, browseRequest, checkDelivery, cleanPendingMessage, cleanPendingMessage, cleanWaitingRequest, cleanWaitingRequest, clear, decode, deliverMessages, denyRequest, doAdminSyncNotification, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, encode, exportMessages, finalize, getClientMessages, getConsumerLoad, getDefaultDMQId, getDefaultRedeliveryDelay, getDefaultThreshold, getDelayedMessage, getDelayedMessageCount, getDelayedMessages, getDeliveredMessageCount, getDeliveryDelay, getEncodedSize, getMessage, getMessages, getMessagesView, getMsgTxPrefix, getNbMaxMsg, getNbMsgsDeniedSinceCreation, getPendingMessageCount, getProducerLoad, getQueueMessage, getRedeliveryDelay, getStats, getThreshold, getType, getWaitingRequestCount, handleAdminRequestNot, handleExpiredNot, isPause, isSyncExceptionOnFullDest, isUndeliverable, isValidJMXAttribute, messageDelivered, messageRemoved, processDeliveryTime, react, receiveRequest, setDefaultRedeliveryDelay, setDeliveryDelay, setMsgTxName, setNbMaxMsg, setPause, setRedeliveryDelay, setSyncExceptionOnFullDest, setThreshold, storeMessage
-
Methods inherited from class org.objectweb.joram.mom.dest.Destination
agentInitialize, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getJMXStatistics, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, interceptorsAvailable, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isWriter, processAdminCommand, processInterceptors, processPause, processStartHandler, processStopHandler, replyToTopic, requestGroupNot, setAdminId, setFreeReading, setFreeWriting, setPeriod, setRight, unknownAgent
-
Methods inherited from class fr.dyade.aaa.agent.Agent
delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, incWorkInProgress, isAgentProfiling, isDeployed, isFixed, isUpdated, load, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface fr.dyade.aaa.agent.AgentMBean
getAgentId, getCommitTime, getReactNb, getReactTime, isAgentProfiling, isFixed, resetCommitTime, resetReactTime, resetTimer, setAgentProfiling
-
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getType, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
-
Methods inherited from interface org.objectweb.joram.mom.dest.QueueMBean
cleanPendingMessage, cleanWaitingRequest, clear, exportMessages, getConsumerLoad, getDelayedMessage, getDelayedMessageCount, getDelayedMessages, getDeliveredMessageCount, getDeliveryDelay, getMessage, getMessages, getNbMaxMsg, getNbMsgsDeniedSinceCreation, getPendingMessageCount, getProducerLoad, getRedeliveryDelay, getThreshold, getWaitingRequestCount, isPause, setDeliveryDelay, setNbMaxMsg, setPause, setRedeliveryDelay, setThreshold
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
DEFAULT_PERIOD
public static final long DEFAULT_PERIOD
Default period used to clean queue and re-distribute failing messages.- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
distributionModule
private transient DistributionModule distributionModule
-
distributionDaemon
private transient DistributionDaemon distributionDaemon
-
distributionClassName
private String distributionClassName
The acquisition class name.
-
batchDistribution
private boolean batchDistribution
Tells if we try to distribute the each message each time (true) or if the distribution is stopped on first error (false). Batch mode can (and will probably) lose message ordering but will not stop deliverable messages in the queue waiting for previous ones to be sent.
-
isAsyncDistribution
private boolean isAsyncDistribution
Tells if daemon distribution is active. On true, the batchDistribution is set.
-
properties
private Properties properties
-
nbMsgsReceiveSinceCreation
protected long nbMsgsReceiveSinceCreation
-
-
Method Detail
-
dumpProperties
public String dumpProperties()
- Specified by:
dumpPropertiesin interfaceDistributionQueueMBean
-
setProperties
public void setProperties(Properties properties, boolean firstTime) throws Exception
Configures aDistributionQueueinstance.- Overrides:
setPropertiesin classQueue- Parameters:
properties- The initial set of properties.- Throws:
Exception
-
isAsyncDistribution
private boolean isAsyncDistribution(Properties properties)
-
initialize
public void initialize(boolean firstTime) throws ExceptionDescription copied from class:QueueInitializes the destination.- Overrides:
initializein classQueue- Parameters:
firstTime- true when first called by the factory- Throws:
Exception
-
agentFinalize
public void agentFinalize(boolean lastTime)
Description copied from class:DestinationFinalizes the agent before it is garbaged.- Overrides:
agentFinalizein classDestination- Parameters:
lastTime- true if the destination is deleted
-
getNbMsgsReceiveSinceCreation
public final long getNbMsgsReceiveSinceCreation()
Description copied from class:DestinationReturns the number of messages received since creation time of this destination.- Specified by:
getNbMsgsReceiveSinceCreationin interfaceDestinationMBean- Overrides:
getNbMsgsReceiveSinceCreationin classQueue- Returns:
- the number of messages received since creation time.
-
getNbMsgsDeliverSinceCreation
public final long getNbMsgsDeliverSinceCreation()
Description copied from class:DestinationReturns the number of messages delivered since creation time of this destination. It includes messages all delivered messages to a consumer, already acknowledged or not.- Specified by:
getNbMsgsDeliverSinceCreationin interfaceDestinationMBean- Overrides:
getNbMsgsDeliverSinceCreationin classQueue- Returns:
- the number of messages delivered since creation time.
-
preProcess
public ClientMessages preProcess(AgentId from, ClientMessages cm)
Description copied from class:DestinationThis method is needed to add processing before the standard handling. It is used in subclass ofQueueandTopic. The incoming messages can be modified or deleted during the processing.- Overrides:
preProcessin classDestination- Parameters:
from- The sender of the messagecm- The incoming messages.- Returns:
- The incoming messages after processing.
-
removeAndDeleteMessages
private void removeAndDeleteMessages()
-
removeAndDeleteMessage
private void removeAndDeleteMessage(String id)
-
postProcess
protected void postProcess(ClientMessages cm)
Description copied from class:DestinationThis method is needed to add processing after the standard handling. It is used in subclass ofQueueandTopic. The incoming messages can be modified or deleted during the processing.- Overrides:
postProcessin classDestination- Parameters:
cm- The incoming messages.
-
toString
public String toString()
Description copied from class:QueueReturns a string representation of this destination.- Specified by:
toStringin interfaceAgentMBean- Specified by:
toStringin interfaceDestinationMBean- Overrides:
toStringin classQueue- Returns:
- a string representation of this destination.
-
wakeUpNot
public void wakeUpNot(WakeUpNot not)
wake up, and cleans the queue.
-
processSetRight
protected void processSetRight(AgentId user, int right) throws RequestException
Description copied from class:Destinationset user right.- Overrides:
processSetRightin classDestination- Throws:
RequestException
-
getEncodableClassId
public int getEncodableClassId()
Description copied from class:AgentEnables the sub classes not to implement this method.- Specified by:
getEncodableClassIdin interfaceEncodable- Overrides:
getEncodableClassIdin classQueue- Returns:
- -1
-
-