Package org.objectweb.joram.mom.dest
Class ElasticTopic
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- org.objectweb.joram.mom.dest.Destination
-
- org.objectweb.joram.mom.dest.Topic
-
- org.objectweb.joram.mom.dest.ElasticTopic
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable,ClusterDestinationMBean,DestinationMBean,TopicMBean
public class ElasticTopic extends Topic
Class describing a node of a scalable topic tree.- Author:
- Ahmed El Rheddane
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classElasticTopic.TopicDesc
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate booleanisRootTrue if topic is head of the elastic topic tree.private static Loggerloggerprivate List<ElasticTopic.TopicDesc>poolPool of topics to forward msgs to.private static longserialVersionUIDprivate intsubIdIndex of topic to forward next subscription to.-
Fields inherited from class org.objectweb.joram.mom.dest.Topic
fatherId, friends, nbMsgsReceiveSinceCreation, selectors, subscribers
-
Fields inherited from class org.objectweb.joram.mom.dest.Destination
clients, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, 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 ElasticTopic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private MessagecreateReconnectionMessage(int tid)protected voiddoClientMessages(AgentId from, ClientMessages not, boolean throwsExceptionOnFullDest)Method specifically processing aClientMessagesinstance.voidhandleAdminRequestNot(AgentId from, FwdAdminRequestNot not)This method handles the scaling operations.private voidhandleClientSubscriptionNot(AgentId from, ClientSubscriptionNot not)If root, redirects subscriptions to proper topic.private voidhandleGetSubscriptionsRequest(FwdAdminRequestNot not)private voidhandleScaleRequest(FwdAdminRequestNot not)voidreact(AgentId from, Notification not)Distributes the received notifications to the appropriate reactions.voidsetProperties(Properties properties, boolean firstTime)Sets the configuration of aDestination.-
Methods inherited from class org.objectweb.joram.mom.dest.Topic
clusterJoin, clusterJoinAck, createTopicForward, doDeleteNot, doRightRequest, doUnknownAgent, finalize, forwardMessages, forwardMessages, getClusterElements, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getStats, getSubscriberIds, getType, initialize, processMessages, sendToCluster, subscribeRequest, topicForwardNot, toString, unsubscribeRequest, wakeUpNot
-
Methods inherited from class org.objectweb.joram.mom.dest.Destination
agentFinalize, agentInitialize, clientMessages, decode, delete, deleteNot, encode, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getEncodedSize, getJMXStatistics, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, interceptorsAvailable, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isValidJMXAttribute, isWriter, postProcess, preProcess, processAdminCommand, processInterceptors, processPause, processSetRight, processStartHandler, processStopHandler, replyToTopic, requestGroupNot, setAdminId, setFreeReading, setFreeWriting, setPeriod, setRight, unknownAgent
-
Methods inherited from class fr.dyade.aaa.agent.Agent
agentSave, delete, delete, deploy, deploy, doAdminSyncNotification, getAgentId, getCommitTime, getEncodableClassId, 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, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
pool
private List<ElasticTopic.TopicDesc> pool
Pool of topics to forward msgs to.
-
isRoot
private boolean isRoot
True if topic is head of the elastic topic tree.
-
subId
private int subId
Index of topic to forward next subscription to.
-
-
Method Detail
-
setProperties
public void setProperties(Properties properties, boolean firstTime) throws Exception
Description copied from class:DestinationSets the configuration of aDestination. Be careful, this is done a first time beforeAgent.deploy(), so the agent is serialized and initialized afterwards.
After deployment, firstTime argument is set to false.- Overrides:
setPropertiesin classDestination- Parameters:
properties- The initial set of properties.- Throws:
Exception
-
handleAdminRequestNot
public void handleAdminRequestNot(AgentId from, FwdAdminRequestNot not)
This method handles the scaling operations.
-
react
public void react(AgentId from, Notification not) throws Exception
Description copied from class:TopicDistributes the received notifications to the appropriate reactions.
-
doClientMessages
protected void doClientMessages(AgentId from, ClientMessages not, boolean throwsExceptionOnFullDest)
Description copied from class:TopicMethod specifically processing aClientMessagesinstance.This method may forward the messages to the topic father if any, or to the cluster fellows if any.It may finally send
TopicMsgsReplyinstances to the valid subscribers.- Overrides:
doClientMessagesin classTopic
-
handleGetSubscriptionsRequest
private void handleGetSubscriptionsRequest(FwdAdminRequestNot not)
-
handleScaleRequest
private void handleScaleRequest(FwdAdminRequestNot not)
-
handleClientSubscriptionNot
private void handleClientSubscriptionNot(AgentId from, ClientSubscriptionNot not)
If root, redirects subscriptions to proper topic.- Parameters:
from- should be the local default user agent.not- Notification of a new client subscriptions.
-
createReconnectionMessage
private Message createReconnectionMessage(int tid)
-
-