|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.scribe.Topic
Field Summary | |
static int |
CREATED
The two states in which Topic can be. |
static int |
JOINING
|
protected java.util.Set |
m_apps
Set of IScribeApps that have subscribed to this Topic. |
protected java.util.Set |
m_children
Set of NodeHandle objects for the local node's children in this topic's multicast subtree rooted at the local node. |
int |
m_heartBeatsMissed
This keeps track of the number of heartbeat messages missed corresponding to this topic. |
protected NodeHandle |
m_parent
Local node's parent in this topic's multicast tree |
Scribe |
m_scribe
The scribe object on which this topic resides. |
int |
m_state
Current state of Topic. |
protected NodeId |
m_topicId
This topic's identifier |
protected boolean |
m_topicManager
Indicates whether this node is manager of this topic. |
protected boolean |
m_wantUnsubscribe
Flag indicating if the local node is waiting to be unsubscribed (because it still does not know parent) |
Constructor Summary | |
Topic(NodeId topicId,
Scribe scribe)
Constructs an empty Topic |
Method Summary | |
boolean |
addChild(NodeHandle child,
ScribeMessage msg)
Adds a node to the Set of children in this topic's multicast subtree rooted at this node |
boolean |
addChild(NodeHandle child,
ScribeMessage msg,
java.io.Serializable data)
Adds a node to the Set of children in this topic's multicast subtree rooted at this node. |
void |
addToScribe()
Creates a topic reference on the current Scribe node. |
IScribeApp[] |
getApps()
Gets all the applications that wish to receive events regarding this Topic. |
java.util.Vector |
getChildren()
This returns the most current view of the children in this topic's multicast subtree rooted at the local node. |
NodeHandle |
getParent()
Returns the local node's parent in this topic's multicast tree. |
int |
getState()
Gets the current state of topic. |
NodeId |
getTopicId()
Returns the topic's id |
boolean |
hasChildren()
Indicates if the local node has children associated with this topic. |
boolean |
hasSubscribers()
If this topic has any applications registered as subscribers. |
boolean |
isTopicManager()
Return boolean indicating if the node is topic manager for the current topic. |
boolean |
isWaitingUnsubscribe()
Returns true if the local node is waiting to be unsubscribed from this topic. |
void |
postponeParentHandler()
Resets the number of heartbeat messages corresponding to this topic to zero. |
boolean |
removeChild(NodeHandle child,
ScribeMessage msg)
Removes a node from the Set of children in this topic's multicast subtree rooted at this node |
void |
removeFromScribe()
Removes this topic reference on the current Scribe node. |
void |
setParent(NodeHandle parent)
Sets the local node's parent in this topic's multicast tree. |
void |
setState(int state)
Set the state of topic to state |
void |
subscribe(IScribeApp app)
Register an application as a subscriber to this Topic, so that the application receives events related to the Topic. |
void |
topicManager(boolean topicMgr)
Sets the flag indicating whether the current node is topic manager for this topic |
void |
unsubscribe(IScribeApp app)
Unregister an application as a Subscriber to this Topic, so that the application no longer receives events regarding this Topic. |
void |
waitUnsubscribe(boolean wait)
Sets flag indicating if the local node is waiting to be unsubscribed from this topic (because it does not yet know its parent) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected NodeId m_topicId
protected java.util.Set m_children
protected NodeHandle m_parent
protected boolean m_wantUnsubscribe
protected boolean m_topicManager
protected java.util.Set m_apps
public int m_heartBeatsMissed
public Scribe m_scribe
public static final int CREATED
public static final int JOINING
public int m_state
Constructor Detail |
public Topic(NodeId topicId, Scribe scribe)
topicId
- unique id for this topic.scribe
- the scribe system in which the topic resides.Method Detail |
public NodeId getTopicId()
public void setState(int state)
state
- The state to which current topic should be set to.public int getState()
public boolean addChild(NodeHandle child, ScribeMessage msg)
child
- the node to be added as a child.msg
- the ScribeMessage which triggered this action,
it can be SUBSCRIBE msg, or null if application
on top of Scribe called addChild()
public boolean addChild(NodeHandle child, ScribeMessage msg, java.io.Serializable data)
child
- the node to be added as a child.msg
- the ScribeMessage which triggered this action,
it can be SUBSCRIBE msg, or null if application
on top of Scribe called addChild()data
- The serializable data.
public boolean removeChild(NodeHandle child, ScribeMessage msg)
child
- the child node to be removed from the multicast tree.msg
- the ScribeMessage which triggered this action,
it can be UNSUBSCRIBE msg, or null if application
on top of Scribe called removeChild() or this child
became dead
public boolean hasChildren()
public java.util.Vector getChildren()
public void setParent(NodeHandle parent)
parent
- the node to be the parent.public NodeHandle getParent()
public void subscribe(IScribeApp app)
app
- The application to be registered.public void unsubscribe(IScribeApp app)
app
- The application to be unregistered.public boolean hasSubscribers()
public void waitUnsubscribe(boolean wait)
wait
- value to set flagpublic boolean isWaitingUnsubscribe()
public void topicManager(boolean topicMgr)
topicMgr
- value of the flagpublic boolean isTopicManager()
public void postponeParentHandler()
public void addToScribe()
public void removeFromScribe()
public IScribeApp[] getApps()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |