Class SchedulerQueue
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- org.objectweb.joram.mom.dest.Destination
-
- org.objectweb.joram.mom.dest.Queue
-
- com.scalagent.joram.mom.dest.scheduler.SchedulerQueue
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable,DestinationMBean,QueueMBean
public class SchedulerQueue extends Queue
This class overrides the default Queue behavior in order to allow timed deliveries. When such a queue receives a message with a property called 'scheduleDate' then the message is not available for delivery before the specified date.- 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 static booleanDEBUGprivate static Loggerloggerstatic StringSCHEDULE_DATEstatic StringSCHEDULEDprivate Schedulerschedulerprivate static longserialVersionUIDdefine serialVersionUID for interoperability-
Fields inherited from class org.objectweb.joram.mom.dest.Queue
ARRIVAL_STATE_PREFIX, arrivalState, delayed, DELIVERY_TABLE_PREFIX, DELIVERY_TIMEOUT, deliveryTable, LENIENT_REDELIVERY_DELAY, LENIENT_UNDELIVERABLE, messages, nbExpirations, nbMaxMsg, nbMsgsDeniedSinceCreation, receiving, requests
-
Fields inherited from class org.objectweb.joram.mom.dest.Destination
clients, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, 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 SchedulerQueue()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckDelivery(Message msg)Returns true if conditions are ok to deliver the message.private voidcondition(SchedulerQueueNot not)intgetEncodableClassId()Enables the sub classes not to implement this method.private static longgetScheduleDate(Message msg)voidinitialize(boolean firstTime)Initializes the destination.voidpostProcess(ClientMessages not)This method is needed to add processing after the standard handling.voidreact(AgentId from, Notification not)Distributes the received notifications to the appropriate reactions.-
Methods inherited from class org.objectweb.joram.mom.dest.Queue
abortReceiveRequest, acknowledgeRequest, addClientMessages, addMessage, agentSave, browseRequest, 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, getNbMsgsDeliverSinceCreation, getNbMsgsDeniedSinceCreation, getNbMsgsReceiveSinceCreation, getPendingMessageCount, getProducerLoad, getQueueMessage, getRedeliveryDelay, getStats, getThreshold, getType, getWaitingRequestCount, handleAdminRequestNot, handleExpiredNot, isPause, isSyncExceptionOnFullDest, isUndeliverable, isValidJMXAttribute, messageDelivered, messageRemoved, receiveRequest, setDefaultRedeliveryDelay, setDeliveryDelay, setMsgTxName, setNbMaxMsg, setPause, setProperties, setRedeliveryDelay, setSyncExceptionOnFullDest, setThreshold, storeMessage, toString, wakeUpNot
-
Methods inherited from class org.objectweb.joram.mom.dest.Destination
agentFinalize, agentInitialize, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getJMXStatistics, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, interceptorsAvailable, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isWriter, preProcess, processAdminCommand, processInterceptors, processPause, processSetRight, 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, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
SCHEDULE_DATE
public static final String SCHEDULE_DATE
- See Also:
- Constant Field Values
-
SCHEDULED
public static final String SCHEDULED
- See Also:
- Constant Field Values
-
scheduler
private Scheduler scheduler
-
-
Method Detail
-
initialize
public void initialize(boolean firstTime) throws ExceptionInitializes the destination.- Overrides:
initializein classQueue- Parameters:
firstTime- true when first called by the factory- Throws:
Exception
-
react
public void react(AgentId from, Notification not) throws Exception
Description copied from class:QueueDistributes the received notifications to the appropriate reactions.
-
postProcess
public void postProcess(ClientMessages not)
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:
not- The incoming messages.
-
getScheduleDate
private static long getScheduleDate(Message msg)
-
condition
private void condition(SchedulerQueueNot not)
-
checkDelivery
protected boolean checkDelivery(Message msg)
Description copied from class:QueueReturns true if conditions are ok to deliver the message. This method must be overloaded in subclasses. Be careful only the message header is accessible.- Overrides:
checkDeliveryin classQueue
-
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
-
-