org.objectweb.joram.mom.dest
Class AcquisitionTopic

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.Topic
              extended by org.objectweb.joram.mom.dest.AcquisitionTopic
All Implemented Interfaces:
AgentMBean, java.io.Serializable, AcquisitionMBean, AcquisitionTopicMBean, ClusterDestinationMBean, DestinationMBean, TopicMBean

public class AcquisitionTopic
extends Topic
implements AcquisitionTopicMBean

The AcquisitionTopic class implements the MOM acquisition topic 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.Topic
alreadySentLocally, fatherId, friends, selectors, subscribers
 
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
AcquisitionTopic()
           
 
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 AcquisitionTopic 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.Topic
clusterJoin, clusterJoinAck, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, forwardMessages, getClusterElements, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getSubscriberIds, getType, handleAdminRequestNot, postSubscribe, postUnsubscribe, preSubscribe, preUnsubscribe, processMessages, sendToCluster, setAlreadySentLocally, subscribeRequest, topicForwardNot, unsubscribeRequest, wakeUpNot
 
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, isValidJMXAttribute, 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.TopicMBean
getNumberOfSubscribers, getSubscriberIds
 
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
 
Methods inherited from interface org.objectweb.joram.mom.dest.ClusterDestinationMBean
getClusterElements
 

Field Detail

logger

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

AcquisitionTopic

public AcquisitionTopic()
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 AcquisitionTopic 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: Topic
Initializes the destination.

Overrides:
initialize in class Topic
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: Topic
Distributes the received notifications to the appropriate reactions.

Overrides:
react in class Topic
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: Topic
Returns a string representation of this destination.

Specified by:
toString in interface AgentMBean
Specified by:
toString in interface DestinationMBean
Overrides:
toString in class Topic
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.