|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.dest.DestinationImpl
org.objectweb.joram.mom.dest.TopicImpl
public class TopicImpl
The TopicImpl
class implements the MOM topic behaviour,
basically distributing the received messages to subscribers.
A Topic might be part of a hierarchy; if it is the case, and if the topic is not on top of that hierarchy, it will have a father to forward messages to.
A topic might also be part of a cluster; if it is the case, it will have friends to forward messages to.
A topic can't be part of a hierarchy and of a cluster at the same time.
Field Summary | |
---|---|
protected boolean |
alreadySentLocally
Internal boolean used for tagging local sendings. |
protected AgentId |
fatherId
Identifier of this topic's father, if any. |
protected java.util.Set |
friends
Set of cluster fellows, if any. |
protected java.util.Hashtable |
selectors
Table of subscribers' selectors. |
private static long |
serialVersionUID
define serialVersionUID for interoperability |
protected java.util.Vector |
subscribers
Vector of subscribers' identifiers. |
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl |
---|
_rights, agent, clients, creationDate, dmqId, freeReading, freeWriting, logger, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, WAKEUP_PERIOD, WRITE |
Constructor Summary | |
---|---|
TopicImpl(AgentId adminId,
java.util.Properties prop)
Constructs a TopicImpl instance. |
Method Summary | |
---|---|
void |
clusterAck(AgentId from,
ClusterAck ack)
Method implementing the reaction to a ClusterAck
notification sent by a topic requested to join the cluster. |
void |
clusterNot(AgentId from,
ClusterNot not)
Method implementing the reaction to a ClusterNot
notification sent by a fellow topic for notifying this topic
of a new cluster fellow insertion or suppression. |
void |
clusterTest(AgentId from,
ClusterTest not)
Method implementing the reaction to a ClusterTest
notification sent by a fellow topic for testing if this topic might be
part of a cluster. |
protected void |
doClientMessages(AgentId from,
ClientMessages not)
Method specifically processing a ClientMessages instance. |
protected void |
doDeleteNot(DeleteNot not)
Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance. |
protected void |
doRightRequest(AgentId user,
int right)
Method specifically processing a SetRightRequest instance. |
protected void |
doUnknownAgent(UnknownAgent uA)
Method specifically processing an UnknownAgent instance. |
protected void |
forwardMessages(ClientMessages messages)
Actually forwards a vector of messages to the father or the cluster fellows, if any. |
long |
getNbMsgsReceiveSinceCreation()
Returns the number of messages received since creation time of this destination. |
int |
getNumberOfSubscribers()
Returns the number of subscribers. |
java.lang.String[] |
getSubscriberIds()
Returns the list of unique identifiers of all subscribers. |
void |
handleAdminRequestNot(AgentId from,
FwdAdminRequestNot not)
|
void |
initialize(boolean firstTime)
Initializes the destination. |
void |
postSubscribe()
Deprecated. |
void |
postUnsubscribe()
Deprecated. |
void |
preSubscribe()
Deprecated. |
void |
preUnsubscribe()
Deprecated. |
protected void |
processMessages(ClientMessages not)
Actually processes the distribution of the received messages to the valid subscriptions by sending a TopicMsgsReply notification
to the valid subscribers. |
void |
setAlreadySentLocally(boolean alreadySentLocally)
|
private void |
setDmq(TopicMsgsReply not)
|
void |
subscribeRequest(AgentId from,
SubscribeRequest not)
Method implementing the reaction to a SubscribeRequest
instance. |
void |
topicForwardNot(TopicForwardNot not)
Method implementing the reaction to a TopicForwardNot
instance, carrying messages forwarded by a cluster fellow or a
hierarchical son. |
java.lang.String |
toString()
Returns a string representation of this destination. |
void |
unsubscribeRequest(AgentId from)
Method implementing the reaction to an UnsubscribeRequest
instance, requesting to remove a subscriber. |
void |
wakeUpNot(WakeUpNot not)
|
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, preProcess, 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.DestinationImplMBean |
---|
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod |
Field Detail |
---|
private static final long serialVersionUID
protected AgentId fatherId
protected java.util.Set friends
protected java.util.Vector subscribers
protected java.util.Hashtable selectors
protected transient boolean alreadySentLocally
Constructor Detail |
---|
public TopicImpl(AgentId adminId, java.util.Properties prop)
TopicImpl
instance.
adminId
- Identifier of the administrator of the topic.prop
- The initial set of properties.Method Detail |
---|
public void initialize(boolean firstTime)
initialize
in class DestinationImpl
firstTime
- true when first called by the factorypublic java.lang.String toString()
toString
in interface DestinationImplMBean
toString
in class java.lang.Object
public void wakeUpNot(WakeUpNot not)
wakeUpNot
in class DestinationImpl
public void clusterTest(AgentId from, ClusterTest not)
ClusterTest
notification sent by a fellow topic for testing if this topic might be
part of a cluster.
public void clusterAck(AgentId from, ClusterAck ack)
ClusterAck
notification sent by a topic requested to join the cluster.
public void clusterNot(AgentId from, ClusterNot not)
ClusterNot
notification sent by a fellow topic for notifying this topic
of a new cluster fellow insertion or suppression.
public void preSubscribe()
public void postSubscribe()
public void subscribeRequest(AgentId from, SubscribeRequest not) throws AccessException
SubscribeRequest
instance.
AccessException
- If the sender is not a READER.public void preUnsubscribe()
public void postUnsubscribe()
public void unsubscribeRequest(AgentId from)
UnsubscribeRequest
instance, requesting to remove a subscriber.
public void topicForwardNot(TopicForwardNot not)
TopicForwardNot
instance, carrying messages forwarded by a cluster fellow or a
hierarchical son.
public void handleAdminRequestNot(AgentId from, FwdAdminRequestNot not)
handleAdminRequestNot
in class DestinationImpl
DestinationImpl.handleAdminRequestNot(fr.dyade.aaa.agent.AgentId, org.objectweb.joram.mom.notifications.FwdAdminRequestNot)
public final int getNumberOfSubscribers()
getNumberOfSubscribers
in interface TopicImplMBean
public final java.lang.String[] getSubscriberIds()
getSubscriberIds
in interface TopicImplMBean
protected void doRightRequest(AgentId user, int right)
SetRightRequest
instance.
When a reader is removed, deleting this reader's subscription if any,
and sending an ExceptionReply
notification to the client.
doRightRequest
in class DestinationImpl
user
- The user about right modification.right
- The right modification.protected void doClientMessages(AgentId from, ClientMessages not)
ClientMessages
instance.
This method may forward the messages to the topic father if any, or
to the cluster fellows if any.It may finally send
TopicMsgsReply
instances to the valid subscribers.
doClientMessages
in class DestinationImpl
protected void doUnknownAgent(UnknownAgent uA)
UnknownAgent
instance.
This method notifies the administrator of the failing cluster or hierarchy building request, if needed, or removes the subscriptions of the deleted client, if any, or sets the father identifier to null if it comes from a deleted father.
doUnknownAgent
in class DestinationImpl
protected void doDeleteNot(DeleteNot not)
fr.dyade.aaa.agent.DeleteNot
instance.
UnknownAgent
notifications are sent to each subscriber
and UnclusterNot
notifications to the cluster
fellows.
doDeleteNot
in class DestinationImpl
protected void forwardMessages(ClientMessages messages)
protected void processMessages(ClientMessages not)
TopicMsgsReply
notification
to the valid subscribers.
private void setDmq(TopicMsgsReply not)
public void setAlreadySentLocally(boolean alreadySentLocally)
public long getNbMsgsReceiveSinceCreation()
DestinationImpl
getNbMsgsReceiveSinceCreation
in interface DestinationImplMBean
getNbMsgsReceiveSinceCreation
in class DestinationImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |