com.scalagent.joram.mom.dest.scheduler
Class SchedulerQueueImpl

java.lang.Object
  extended by org.objectweb.joram.mom.dest.DestinationImpl
      extended by org.objectweb.joram.mom.dest.QueueImpl
          extended by com.scalagent.joram.mom.dest.scheduler.SchedulerQueueImpl
All Implemented Interfaces:
java.io.Serializable, DestinationImplMBean, QueueImplMBean

public class SchedulerQueueImpl
extends QueueImpl

This class overrides the default QueueImpl 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

Field Summary
static org.objectweb.util.monolog.api.Logger logger
           
static java.lang.String SCHEDULE_DATE
           
static java.lang.String SCHEDULED
           
private  Scheduler scheduler
           
private static long serialVersionUID
          define serialVersionUID for interoperability
 
Fields inherited from class org.objectweb.joram.mom.dest.QueueImpl
arrivalsCounter, consumers, contexts, deliveredMsgs, messages, nbMaxMsg, receiving, requests
 
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl
_rights, agent, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, WAKEUP_PERIOD, WRITE
 
Constructor Summary
SchedulerQueueImpl(AgentId adminId, java.util.Properties prop)
          Constructs a SchedulerQueueImpl instance.
 
Method Summary
protected  boolean checkDelivery(Message msg)
          Returns true if conditions are ok to deliver the message.
 void condition(SchedulerQueueNot not)
           
private static long getScheduleDate(Message msg)
           
 void initialize(boolean firstTime)
          Initializes the destination.
 void postProcess(ClientMessages not)
          This method is needed to add processing after the standard handling.
 
Methods inherited from class org.objectweb.joram.mom.dest.QueueImpl
abortReceiveRequest, acknowledgeRequest, addClientMessages, addMessage, browseRequest, cleanPendingMessage, cleanPendingMessage, cleanWaitingRequest, cleanWaitingRequest, deliverMessages, denyRequest, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, getClientMessages, getDefaultDMQId, getDefaultThreshold, getDeliveredMessageCount, getMessage, getMessages, getMessagesView, getMsgTxPrefix, getNbMaxMsg, getNbMsgsReceiveSinceCreation, getPendingMessageCount, getQueueMessage, getThreshold, getWaitingRequestCount, handleAdminRequestNot, handleExpiredNot, isUndeliverable, isValidJMXAttribute, messageDelivered, messageRemoved, readBag, receiveRequest, setMsgTxName, setNbMaxMsg, setThreshold, storeMessage, storeMessageHeader, toString, wakeUpNot, writeBag
 
Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl
canBeDeleted, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getId, getJMXStatistics, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isWriter, preProcess, processSetRight, replyToTopic, requestGroupNot, setAgent, setFreeReading, setFreeWriting, setPeriod, setRight, specialAdminProcess, specialAdminRequest, unknownAgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationImplMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, 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

public static org.objectweb.util.monolog.api.Logger logger

SCHEDULE_DATE

public static final java.lang.String SCHEDULE_DATE
See Also:
Constant Field Values

SCHEDULED

public static final java.lang.String SCHEDULED
See Also:
Constant Field Values

scheduler

private Scheduler scheduler
Constructor Detail

SchedulerQueueImpl

public SchedulerQueueImpl(AgentId adminId,
                          java.util.Properties prop)
Constructs a SchedulerQueueImpl instance.

Parameters:
adminId - Identifier of the administrator of the queue.
prop - The initial set of properties.
Method Detail

initialize

public void initialize(boolean firstTime)
Initializes the destination.

Overrides:
initialize in class QueueImpl
Parameters:
firstTime - true when first called by the factory

postProcess

public void postProcess(ClientMessages not)
Description copied from class: DestinationImpl
This method is needed to add processing after the standard handling. It is used in subclass of QueueImpl and TopicImpl. The incoming messages can be modified or deleted during the processing.

Overrides:
postProcess in class DestinationImpl
Parameters:
not - The incoming messages.

getScheduleDate

private static long getScheduleDate(Message msg)

condition

public void condition(SchedulerQueueNot not)

checkDelivery

protected boolean checkDelivery(Message msg)
Description copied from class: QueueImpl
Returns 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:
checkDelivery in class QueueImpl


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.