org.apache.geronimo.clustering
Class Node

java.lang.Object
  extended byorg.apache.geronimo.clustering.MBeanImpl
      extended byorg.apache.geronimo.clustering.NamedMBeanImpl
          extended byorg.apache.geronimo.clustering.Node
All Implemented Interfaces:
DataDeltaListener, DataListener, MetaDataListener

public class Node
extends NamedMBeanImpl
implements MetaDataListener, DataListener, DataDeltaListener

A Node is an instance of a connection to a Cluster. Nodes are named uniquely within their Cluster and VM. A VM may contain more than one Node.

Version:
$Revision: 1.10 $ $Date: 2004/03/10 09:58:21 $

Field Summary
protected  Cluster _cluster
           
protected  Data _data
           
protected  org.apache.commons.logging.Log _log
           
 
Fields inherited from class org.apache.geronimo.clustering.MBeanImpl
_objectName, _server
 
Constructor Summary
Node()
           
 
Method Summary
 void applyDataDelta(DataDelta delta)
          Called by Cluster to notify node of a change to Cluster state.
 boolean canStart()
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 Cluster getCluster()
           
 String getClusterName()
          Returns the Node's Cluster's MBean's unique identifier.
 javax.management.ObjectName getClusterObjectName()
           
 Data getData()
          Called by Cluster to retrieve current Cluster state.
static javax.management.ObjectName makeObjectName(String clusterName, String nodeName)
          Makes an ObjectName for a Node MBean with the given parameters.
 void setData(Data data)
          Called by Cluster to initialise the state of a [new] node.
 void setMetaData(List members)
          Called by Cluster when a change in membership occurs.
 
Methods inherited from class org.apache.geronimo.clustering.NamedMBeanImpl
getName
 
Methods inherited from class org.apache.geronimo.clustering.MBeanImpl
canStop, getObjectName, getReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected org.apache.commons.logging.Log _log

_cluster

protected Cluster _cluster

_data

protected Data _data
Constructor Detail

Node

public Node()
Method Detail

makeObjectName

public static javax.management.ObjectName makeObjectName(String clusterName,
                                                         String nodeName)
                                                  throws Exception
Makes an ObjectName for a Node MBean with the given parameters.

Parameters:
clusterName - a String value
nodeName - a String value
Returns:
an ObjectName value
Throws:
Exception - if an error occurs

getClusterName

public String getClusterName()
Returns the Node's Cluster's MBean's unique identifier.

Returns:
a String value

getCluster

public Cluster getCluster()

getClusterObjectName

public javax.management.ObjectName getClusterObjectName()

setMetaData

public void setMetaData(List members)
Description copied from interface: MetaDataListener
Called by Cluster when a change in membership occurs. This is better than a memberLeft/memberJoined notification as it can handle multiple concurrent leave/joins, this may occur in the case of event elysion...

Specified by:
setMetaData in interface MetaDataListener
Parameters:
members - a List of members.

getData

public Data getData()
Description copied from interface: DataListener
Called by Cluster to retrieve current Cluster state.

Specified by:
getData in interface DataListener

setData

public void setData(Data data)
Description copied from interface: DataListener
Called by Cluster to initialise the state of a [new] node.

Specified by:
setData in interface DataListener
Parameters:
data - Data to be used as the node's initial state.

applyDataDelta

public void applyDataDelta(DataDelta delta)
Description copied from interface: DataDeltaListener
Called by Cluster to notify node of a change to Cluster state.

Specified by:
applyDataDelta in interface DataDeltaListener
Parameters:
delta - a DataDelta to be applied to the node's current state.

canStart

public boolean canStart()
Overrides:
canStart in class NamedMBeanImpl

doStart

public void doStart()
Overrides:
doStart in class MBeanImpl

doStop

public void doStop()
Overrides:
doStop in class MBeanImpl

doFail

public void doFail()
Overrides:
doFail in class MBeanImpl


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.