|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xmlBlaster.engine.cluster.ClusterNode
public final class ClusterNode
This class holds the informations about an xmlBlaster server instance (=cluster node).
It collects the node informations from NodeInfo.java, NodeMasterInfo.java and NodeStateInfo.java
Field Summary | |
---|---|
private boolean |
available
|
private I_ConnectionStateListener |
connectionStateListener
|
private ContextNode |
contextNode
|
private ServerScope |
fatherGlob
|
private boolean |
isAllowed
Currently always true, needs to be configurable !!! TODO |
private static java.util.logging.Logger |
log
|
private java.util.Map |
masterInfoMap
Hold mapping informations to map a message to a master node. |
private java.lang.Object |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
private NodeConnectQos |
nodeInfo
Holds address and backup informations |
private Global |
remoteGlob
This util global instance is used for I_XmlBlasterAccess, it uses the specific settings from NodeInfo to connect to the remote node |
private SessionInfo |
sessionInfo
|
private NodeStateInfo |
state
Holds performance informations for load balancing |
private I_XmlBlasterAccess |
xmlBlasterConnection
|
Constructor Summary | |
---|---|
ClusterNode(ServerScope glob,
NodeId nodeId,
SessionInfo sessionInfo)
Create an object holding all informations about a node |
Method Summary | |
---|---|
void |
addNodeMasterInfo(NodeMasterInfo domainInfo)
Set the filter rules to determine the master of a message. |
int |
compareTo(java.lang.Object obj)
Needed for TreeSet and MapSet, implements Comparable. |
java.lang.String |
destroy()
For JMX only. |
I_Queue |
getConnectionQueue()
|
int |
getConnectionState()
Returns the current connection state to the node. |
java.lang.String |
getConnectionStateStr()
For JMX access. |
ContextNode |
getContextNode()
|
java.lang.String |
getId()
Convenience, delegates call to NodeInfo. |
NodeId |
getNodeId()
Convenience, delegates call to NodeInfo. |
NodeConnectQos |
getNodeInfo()
Access the current nodeInfo of the node. |
NodeMasterInfo[] |
getNodeMasterInfos()
Access the filter rules to determine the master of a message. |
NodeStateInfo |
getNodeStateInfo()
Access the current state of the node, like current CPU and memory informations. |
Global |
getRemoteGlob()
|
SessionName |
getRemoteSessionName()
Contains remote clusterNodeId |
SessionName |
getSessionName()
Directly from xmlBlasterAccess, may not contain clusterNodeId |
I_XmlBlasterAccess |
getXmlBlasterAccess()
On first invocation we connect to the other xmlBlaster cluster node. |
boolean |
isAlive()
Check if we currently have an open connection to this node. |
boolean |
isAllowed()
Is this node usable. |
boolean |
isAvailable()
|
boolean |
isConnected()
Check if we have currently a functional connection to this node. |
boolean |
isLocalNode()
Check if we have currently a functional connection to this node. |
boolean |
isPolling()
Check if we are currently polling for a connection to this node. |
void |
ping()
Force a async ping to re-check connection to server. |
void |
reachedAlive(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode if the connection was established. |
void |
reachedAliveSync(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
Invoked when the dispatcher goes to synch again after having delivered entries which where in the queue when the state changed to ALIVE. |
void |
reachedDead(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode if the connection was lost. |
void |
reachedPolling(ConnectionStateEnum oldState,
I_XmlBlasterAccess connection)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode if the connection was lost. |
void |
registerConnectionListener(I_ConnectionStateListener connectionListener)
Register a listener to get events about connection status changes. |
void |
removeNodeMasterInfo(NodeMasterInfo domainInfo)
|
java.lang.String |
replace(NodeMasterInfo old,
java.lang.String xmlNew)
|
void |
resetXmlBlasterAccess(boolean force)
|
void |
setAllowed(boolean allowed)
|
void |
setNodeId(NodeId nodeId)
Convenience, delegates call to NodeInfo. |
void |
setNodeInfo(NodeConnectQos nodeInfo)
Overwrite the current nodeInfo of the node. |
void |
setNodeStateInfo(NodeStateInfo state)
Access the current state of the node, like current CPU and memory informations. |
void |
shutdown()
|
java.lang.String |
toString()
|
java.lang.String |
toXml()
Dump state of this object into a XML ASCII string. |
java.lang.String |
toXml(java.lang.String extraOffset,
java.util.Properties props)
Dump state of this object into a XML ASCII string. |
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final java.lang.String ME
private final ServerScope fatherGlob
private final Global remoteGlob
private static java.util.logging.Logger log
private final SessionInfo sessionInfo
private I_XmlBlasterAccess xmlBlasterConnection
private boolean available
private NodeConnectQos nodeInfo
private NodeStateInfo state
private I_ConnectionStateListener connectionStateListener
private java.util.Map masterInfoMap
private boolean isAllowed
private ContextNode contextNode
private java.lang.Object mbeanHandle
Constructor Detail |
---|
public ClusterNode(ServerScope glob, NodeId nodeId, SessionInfo sessionInfo) throws XmlBlasterException
XmlBlasterException
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getId()
public NodeId getNodeId()
public void setNodeId(NodeId nodeId)
The
- unique name of the managed xmlBlaster instancepublic void registerConnectionListener(I_ConnectionStateListener connectionListener)
connectionListener
- null or your listener implementation on connection state changes
(ALIVE | POLLING | DEAD)public void ping()
public I_XmlBlasterAccess getXmlBlasterAccess() throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess
,
I_XmlBlasterAccess.registerConnectionListener(org.xmlBlaster.client.I_ConnectionStateListener)
public void resetXmlBlasterAccess(boolean force)
force
- shutdown even if no public NodeConnectQos getNodeInfo()
public void setNodeInfo(NodeConnectQos nodeInfo)
public NodeStateInfo getNodeStateInfo()
public void setNodeStateInfo(NodeStateInfo state)
public NodeMasterInfo[] getNodeMasterInfos()
public java.lang.String replace(NodeMasterInfo old, java.lang.String xmlNew)
public void addNodeMasterInfo(NodeMasterInfo domainInfo)
public void removeNodeMasterInfo(NodeMasterInfo domainInfo)
public I_Queue getConnectionQueue()
public SessionName getRemoteSessionName()
public SessionName getSessionName()
public boolean isConnected() throws XmlBlasterException
XmlBlasterException
public boolean isPolling() throws XmlBlasterException
XmlBlasterException
public boolean isAlive() throws XmlBlasterException
XmlBlasterException
public boolean isAllowed()
isAllowed
in interface ClusterNodeMBean
public void setAllowed(boolean allowed)
setAllowed
in interface ClusterNodeMBean
public java.lang.String getConnectionStateStr()
getConnectionStateStr
in interface ClusterNodeMBean
public int getConnectionState() throws XmlBlasterException
XmlBlasterException
public boolean isLocalNode()
isLocalNode
in interface ClusterNodeMBean
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
reachedAlive
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public void reachedAliveSync(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
I_ConnectionStateListener
reachedAliveSync
in interface I_ConnectionStateListener
oldState
- is always ALIVE.public void reachedPolling(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
reachedPolling
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public void reachedDead(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
reachedDead
in interface I_ConnectionStateListener
oldState
- The previous state of the connection.public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
update
in interface I_Callback
cbSessionId
- The session ID specified by the client which registered the callback.
You can specify a cbSessionId during connection (with ConnectQos)
and this is bounced back here so you can authenticate the message.updateKey
- The arrived key containing the topic namecontent
- The arrived message content. This is your payload.
XmlBlasterException
I_Callback.update(String, UpdateKey, byte[], UpdateQos)
public java.lang.String destroy()
destroy
in interface ClusterNodeMBean
public void shutdown()
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset, java.util.Properties props)
extraOffset
- indenting of tags for nice outputpublic boolean isAvailable()
isAvailable
in interface ClusterNodeMBean
public Global getRemoteGlob()
public ContextNode getContextNode()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |