org.objectweb.joram.mom.dest
Class AcquisitionTopicImpl

java.lang.Object
  extended by org.objectweb.joram.mom.dest.DestinationImpl
      extended by org.objectweb.joram.mom.dest.TopicImpl
          extended by org.objectweb.joram.mom.dest.AcquisitionTopicImpl
All Implemented Interfaces:
java.io.Serializable, AcquisitionMBean, AcquisitionTopicImplMBean, DestinationImplMBean, TopicImplMBean

public class AcquisitionTopicImpl
extends TopicImpl
implements AcquisitionTopicImplMBean

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

See Also:
Serialized Form

Field Summary
private  java.lang.String acquisitionClassName
          The acquisition class name.
private  AcquisitionModule acquisitionModule
          The acquisition module.
private  java.lang.String lastMessageId
          Stores the id of the last message received to avoid duplicates.
static org.objectweb.util.monolog.api.Logger logger
           
private  long msgCount
          The number of produced messages.
private  java.util.Properties properties
          Stores the last set of properties defined.
private static long serialVersionUID
          define serialVersionUID for interoperability
 
Fields inherited from class org.objectweb.joram.mom.dest.TopicImpl
alreadySentLocally, fatherId, friends, selectors, subscribers
 
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl
_rights, agent, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, WAKEUP_PERIOD, WRITE
 
Constructor Summary
AcquisitionTopicImpl(AgentId adminId, java.util.Properties properties)
          Constructs an AcquisitionTopicImpl instance.
 
Method Summary
 void acquisitionNot(AcquisitionNot not)
          This method process messages from the acquisition module.
 void close()
           
 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 used for configuration, they are processed by the acquisition module and a null ClientMessages is always returned to the base implementation.
 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.
 java.lang.String toString()
          Returns a string representation of this destination.
 
Methods inherited from class org.objectweb.joram.mom.dest.TopicImpl
clusterAck, clusterNot, clusterTest, doClientMessages, doDeleteNot, doRightRequest, doUnknownAgent, forwardMessages, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getSubscriberIds, handleAdminRequestNot, postSubscribe, postUnsubscribe, preSubscribe, preUnsubscribe, processMessages, setAlreadySentLocally, subscribeRequest, topicForwardNot, unsubscribeRequest, wakeUpNot
 
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, isValidJMXAttribute, isWriter, postProcess, processSetRight, replyToTopic, requestGroupNot, setAgent, setFreeReading, setFreeWriting, setNoSave, setPeriod, setRight, setSave, 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.TopicImplMBean
getNumberOfSubscribers, getSubscriberIds
 
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationImplMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, 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

acquisitionModule

private transient AcquisitionModule acquisitionModule
The acquisition module.


properties

private java.util.Properties properties
Stores the last set of properties defined.


lastMessageId

private java.lang.String lastMessageId
Stores the id of the last message received to avoid duplicates.


msgCount

private long msgCount
The number of produced messages.


acquisitionClassName

private java.lang.String acquisitionClassName
The acquisition class name.

Constructor Detail

AcquisitionTopicImpl

public AcquisitionTopicImpl(AgentId adminId,
                            java.util.Properties properties)
                     throws RequestException
Constructs an AcquisitionTopicImpl instance.

Parameters:
adminId - Identifier of the administrator of the topic.
prop - The initial set of properties.
Throws:
RequestException
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.

initialize

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

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

preProcess

public ClientMessages preProcess(AgentId from,
                                 ClientMessages cm)
Incoming JMS messages are used for configuration, they are processed by the acquisition module and a null ClientMessages is always returned to the base implementation.

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

acquisitionNot

public void acquisitionNot(AcquisitionNot not)
This method process messages from the acquisition module. The method addClientMessages of base implementation is used to handle incoming messages.

Parameters:
not -

toString

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

Specified by:
toString in interface DestinationImplMBean
Overrides:
toString in class TopicImpl

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.

close

public void close()

getAcquisitionPeriod

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

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


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