org.apache.geronimo.messaging.cluster
Class ClusterImpl

java.lang.Object
  extended byorg.apache.geronimo.messaging.cluster.ClusterImpl
All Implemented Interfaces:
Cluster, org.apache.geronimo.gbean.GBeanLifecycle

public class ClusterImpl
extends Object
implements Cluster, org.apache.geronimo.gbean.GBeanLifecycle

Cluster implementation.
It manages the nodes at the cluster level and triggers dynamic reconfigurations of the underlying node topology when members are added or removed.

Version:
$Revision: 1.3 $ $Date: 2004/07/20 00:26:03 $

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
ClusterImpl(ClusterInfo aClusterInfo, Node aNode, TopologyManager aTopologyManager)
          Creates a cluster view mounted by the specified node.
 
Method Summary
 void addListener(ClusterEventListener aListener)
          Adds a listener to this cluster.
 void addMember(NodeInfo aNode)
          Adds a Node to this cluster.
 void doFail()
           
 void doStart()
           
 void doStop()
           
 ClusterInfo getClusterInfo()
          Gets the meta-data of this cluster.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 Set getMembers()
          Gets the Nodes of this cluster.
 void removeListener(ClusterEventListener aListener)
          Removes the specified listener.
 void removeMember(NodeInfo aNode)
          Removes a Node from this cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

ClusterImpl

public ClusterImpl(ClusterInfo aClusterInfo,
                   Node aNode,
                   TopologyManager aTopologyManager)
Creates a cluster view mounted by the specified node.

Parameters:
aClusterInfo - Cluster meta-data.
aNode - Node which is mounting this cluster view.
aTopologyManager - Use to reconfigure the node topology when members joined or leaved the cluster.
Method Detail

doStart

public void doStart()
             throws org.apache.geronimo.gbean.WaitingException,
                    Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doStop

public void doStop()
            throws org.apache.geronimo.gbean.WaitingException,
                   Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getClusterInfo

public ClusterInfo getClusterInfo()
Description copied from interface: Cluster
Gets the meta-data of this cluster.

Specified by:
getClusterInfo in interface Cluster
Returns:
Cluster meta-data.

getMembers

public Set getMembers()
Description copied from interface: Cluster
Gets the Nodes of this cluster.

Specified by:
getMembers in interface Cluster
Returns:
Set nodes.

addMember

public void addMember(NodeInfo aNode)
               throws NodeException
Description copied from interface: Cluster
Adds a Node to this cluster.
When a Node is added to a cluster, this latter performs a dynamic reconfiguration of the node topology.
When the topology has been applied, it notifies the registered cluster event listeners of the addition.

Specified by:
addMember in interface Cluster
Parameters:
aNode - Node to be added to this cluster.
Throws:
NodeException - Indicates that the specified node can not be added.

removeMember

public void removeMember(NodeInfo aNode)
                  throws NodeException
Description copied from interface: Cluster
Removes a Node from this cluster.
See addMember for more details on the operations of this method.

Specified by:
removeMember in interface Cluster
Parameters:
aNode -
Throws:
NodeException - Indicates that the specified node can not be removed.

addListener

public void addListener(ClusterEventListener aListener)
Description copied from interface: Cluster
Adds a listener to this cluster.

Specified by:
addListener in interface Cluster
Parameters:
aListener - Listener to be registered.

removeListener

public void removeListener(ClusterEventListener aListener)
Description copied from interface: Cluster
Removes the specified listener.

Specified by:
removeListener in interface Cluster
Parameters:
aListener - Listener to be removed.

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


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