Package de.xima.fc.cluster.impl.jgroup
Class JGroupsClusterConnection
- java.lang.Object
 - 
- de.xima.fc.cluster.impl.jgroup.JGroupsClusterConnection
 
 
- 
- All Implemented Interfaces:
 IClusterConnection,Closeable,Serializable,AutoCloseable
public class JGroupsClusterConnection extends Object implements IClusterConnection, Serializable
Implementation of aIClusterConnectionthat usesEClusterImplementation.JGROUPS.- Author:
 - XIMA MEDIA GmbH
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description JGroupsClusterConnection() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the connection to other nodes.static IClusterConnectioncreate()Methode zum Erstellen einer JGroups-basiertenIClusterConnection-Implementierungvoiddisconnect()Disconnects the node from the cluster.IClusterChannelStateObservergetChannelObserver()IClustergetCluster()StringgetClusterName()IClusterMessageObservergetMessageObserver()StringgetNodeName()IClusterTopologyObservergetTopologyObserver()voidopen()Opens this connection. 
 - 
 
- 
- 
Method Detail
- 
create
public static IClusterConnection create()
Methode zum Erstellen einer JGroups-basiertenIClusterConnection-Implementierung- Returns:
 - an 
IClusterConnection 
 
- 
open
public void open() throws ClusterOpenExceptionDescription copied from interface:IClusterConnectionOpens this connection. When no node exists yet, a new group is created. Otherwise, when a group exists already, joins that groups.- Specified by:
 openin interfaceIClusterConnection- Throws:
 ClusterOpenException- When the connection could not be opened, such as due to a network failure etc.
 
- 
close
public void close()
Description copied from interface:IClusterConnectionCloses the connection to other nodes. This method closes the entire cluster, so that no more nodes can be added to the group.- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Specified by:
 closein interfaceIClusterConnection
 
- 
disconnect
public void disconnect()
Description copied from interface:IClusterConnectionDisconnects the node from the cluster. The node can join the cluster again later by callingIClusterConnection.open().- Specified by:
 disconnectin interfaceIClusterConnection
 
- 
getTopologyObserver
public IClusterTopologyObserver getTopologyObserver()
- Specified by:
 getTopologyObserverin interfaceIClusterConnection- Returns:
 - The observer that can be used to listen for changes to the cluster topology (e.g. when a node is added or removed from the cluster).
 
 
- 
getChannelObserver
public IClusterChannelStateObserver getChannelObserver()
- Specified by:
 getChannelObserverin interfaceIClusterConnection- Returns:
 - The observer that can be used to listen for changes to the channel state, e.g. when the connection to a node was established or cut, or the channel was closed.
 
 
- 
getMessageObserver
public IClusterMessageObserver getMessageObserver()
- Specified by:
 getMessageObserverin interfaceIClusterConnection- Returns:
 - The observer that can be used to listen for messages sent between nodes.
 
 
- 
getClusterName
public String getClusterName()
- Returns:
 - The name of this cluster.
 
 
- 
getNodeName
public String getNodeName()
- Returns:
 - The name of the local node, i.e. the node corresponding to the server running this code.
 
 
- 
getCluster
public ICluster getCluster()
- Specified by:
 getClusterin interfaceIClusterConnection- Returns:
 - The cluster to
 
 
 - 
 
 -