org.objectweb.joram.mom.dest
Class AcquisitionQueue

java.lang.Object
  extended by fr.dyade.aaa.agent.Agent
      extended by org.objectweb.joram.mom.dest.Destination
          extended by org.objectweb.joram.mom.dest.Queue
              extended by org.objectweb.joram.mom.dest.AcquisitionQueue
All Implemented Interfaces:
AgentMBean, BagSerializer, java.io.Serializable, AcquisitionMBean, AcquisitionQueueMBean, DestinationMBean, QueueMBean

public class AcquisitionQueue
extends Queue
implements AcquisitionQueueMBean

The AcquisitionQueue class implements the MOM acquisition queue behavior, basically acquiring messages periodically or on client request, using an AcquisitionModule.

See Also:
Serialized Form

Field Summary
static org.objectweb.util.monolog.api.Logger logger
           
 
Fields inherited from class org.objectweb.joram.mom.dest.Queue
arrivalsCounter, consumers, contexts, deliveredMsgs, messages, nbMaxMsg, receiving, requests
 
Fields inherited from class org.objectweb.joram.mom.dest.Destination
_rights, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, task, WAKEUP_PERIOD, WRITE
 
Fields inherited from class fr.dyade.aaa.agent.Agent
emptyString, fixed, logmon
 
Constructor Summary
AcquisitionQueue()
           
 
Method Summary
 void agentFinalize(boolean lastTime)
          Finalizes the agent before it is garbaged.
 java.lang.String getAcquisitionClassName()
          Returns the acquisition handler class name.
 long getAcquisitionPeriod()
          Returns the acquisition period.
 long getExpiration()
          Returns the expiration value for produced messages.
 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(java.util.Properties properties)
          Configures an AcquisitionQueue instance.
protected  java.util.Properties startHandler(java.util.Properties prop)
          Start the handler.
protected  java.util.Properties stopHandler(java.util.Properties prop)
          Stop the handler.
 java.lang.String toString()
          Returns a string representation of this destination.
 void updateProperties(java.util.Properties prop)
          Update properties configuration, they are processed by the distribution module
 
Methods inherited from class org.objectweb.joram.mom.dest.Queue
abortReceiveRequest, acknowledgeRequest, addClientMessages, addMessage, browseRequest, checkDelivery, cleanPendingMessage, cleanPendingMessage, cleanWaitingRequest, cleanWaitingRequest, deliverMessages, denyRequest, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, getClientMessages, getDefaultDMQId, getDefaultThreshold, getDeliveredMessageCount, getMessage, getMessages, getMessagesView, getMsgTxPrefix, getNbMaxMsg, getNbMsgsReceiveSinceCreation, getPendingMessageCount, getQueueMessage, getThreshold, getType, getWaitingRequestCount, handleAdminRequestNot, handleExpiredNot, isUndeliverable, isValidJMXAttribute, messageDelivered, messageRemoved, readBag, receiveRequest, setMsgTxName, setNbMaxMsg, setThreshold, storeMessage, storeMessageHeader, wakeUpNot, writeBag
 
Methods inherited from class org.objectweb.joram.mom.dest.Destination
agentInitialize, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getJMXStatistics, getMBeanName, getNbMsgsDeliverSinceCreation, 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
 
Methods inherited from class fr.dyade.aaa.agent.Agent
delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName, setNoSave, setSave
 
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.QueueMBean
cleanPendingMessage, cleanWaitingRequest, getDeliveredMessageCount, getMessage, getMessages, getMessagesView, getNbMaxMsg, getPendingMessageCount, getThreshold, getWaitingRequestCount, setNbMaxMsg, setThreshold
 
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
 
Methods inherited from interface fr.dyade.aaa.agent.AgentMBean
getAgentId, getCommitTime, getReactNb, getReactTime, isFixed
 

Field Detail

logger

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

AcquisitionQueue

public AcquisitionQueue()
Method Detail

getAcquisitionClassName

public java.lang.String getAcquisitionClassName()
Description copied from interface: AcquisitionMBean
Returns the acquisition handler class name.

Specified by:
getAcquisitionClassName in interface AcquisitionMBean
Returns:
the acquisition handler class name.

setProperties

public void setProperties(java.util.Properties properties)
                   throws RequestException
Configures an AcquisitionQueue instance.

Overrides:
setProperties in class Destination
Parameters:
properties - The initial set of properties.
Throws:
RequestException

initialize

public void initialize(boolean firstTime)
Description copied from class: Queue
Initializes the destination.

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

react

public void react(AgentId from,
                  Notification not)
           throws java.lang.Exception
Description copied from class: Queue
Distributes the received notifications to the appropriate reactions.

Overrides:
react in class Queue
Parameters:
from - agent sending notification
not - notification to react to
Throws:
java.lang.Exception - unspecialized exception

agentFinalize

public void agentFinalize(boolean lastTime)
Description copied from class: Destination
Finalizes the agent before it is garbaged.

Overrides:
agentFinalize in class Destination
Parameters:
lastTime - true when last called by the factory on agent deletion.

preProcess

public 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.

Overrides:
preProcess in class Destination
Parameters:
from - The sender of the message
cm - The incoming messages.
Returns:
The incoming messages after processing.
See Also:
AcquisitionModule.processMessages(ClientMessages), Destination.preProcess(AgentId, ClientMessages)

updateProperties

public void updateProperties(java.util.Properties prop)
                      throws java.lang.Exception
Update properties configuration, they are processed by the distribution module

Overrides:
updateProperties in class Destination
Parameters:
prop - the new properties.
Throws:
java.lang.Exception

startHandler

protected java.util.Properties startHandler(java.util.Properties prop)
                                     throws java.lang.Exception
Start the handler.

Parameters:
prop - properties for start if needed
Returns:
properties for the reply.
Throws:
java.lang.Exception

stopHandler

protected java.util.Properties stopHandler(java.util.Properties prop)
                                    throws java.lang.Exception
Stop the handler.

Parameters:
prop - properties for stop if needed
Returns:
properties for the reply.
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Description copied from class: Queue
Returns a string representation of this destination.

Specified by:
toString in interface AgentMBean
Specified by:
toString in interface DestinationMBean
Overrides:
toString in class Queue
Returns:
A string representation of this agent.

getExpiration

public long getExpiration()
Description copied from interface: AcquisitionMBean
Returns the expiration value for produced messages.

Specified by:
getExpiration in interface AcquisitionMBean
Returns:
the expiration value for produced messages.

getPriority

public int getPriority()
Description copied from interface: AcquisitionMBean
Returns the priority of produced messages.

Specified by:
getPriority in interface AcquisitionMBean
Returns:
the priority of produced messages.

isMessagePersistent

public boolean isMessagePersistent()
Description copied from interface: AcquisitionMBean
Returns true if the messages produced are persistent.

Specified by:
isMessagePersistent in interface AcquisitionMBean
Returns:
true if the messages produced are persistent.

setExpiration

public void setExpiration(long expiration)
Description copied from interface: AcquisitionMBean
Sets the expiration value for produced messages.

Specified by:
setExpiration in interface AcquisitionMBean
Parameters:
expiration - the expiration to set.

setMessagePersistent

public void setMessagePersistent(boolean isPersistent)
Description copied from interface: AcquisitionMBean
Sets the DeliveryMode value for the produced messages. If the parameter is true the messages produced are persistent.

Specified by:
setMessagePersistent in interface AcquisitionMBean
Parameters:
isPersistent - if true the messages produced are persistent.

setPriority

public void setPriority(int priority)
Description copied from interface: AcquisitionMBean
Sets the priority of produced messages.

Specified by:
setPriority in interface AcquisitionMBean
Parameters:
priority - the priority to set.

getAcquisitionPeriod

public long getAcquisitionPeriod()
Description copied from interface: AcquisitionMBean
Returns the acquisition period.

Specified by:
getAcquisitionPeriod in interface AcquisitionMBean
Returns:
the acquisition period.


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