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
Implementation of a
IClusterConnection that uses EClusterImplementation.JGROUPS.- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection to other nodes.static IClusterConnectioncreate()Methode zum Erstellen einer JGroups-basiertenIClusterConnection-ImplementierungvoidDisconnects the node from the cluster.voidopen()Opens this connection.
-
Constructor Details
-
JGroupsClusterConnection
public JGroupsClusterConnection()
-
-
Method Details
-
create
Methode zum Erstellen einer JGroups-basiertenIClusterConnection-Implementierung- Returns:
- an
IClusterConnection
-
open
Description 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
- 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
- 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
- Specified by:
getMessageObserverin interfaceIClusterConnection- Returns:
- The observer that can be used to listen for messages sent between nodes.
-
getClusterName
- Returns:
- The name of this cluster.
-
getNodeName
- Returns:
- The name of the local node, i.e. the node corresponding to the server running this code.
-
getCluster
- Specified by:
getClusterin interfaceIClusterConnection- Returns:
- The cluster to
-