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 TypeMethodDescriptionvoid
close()
Closes the connection to other nodes.static IClusterConnection
create()
Methode zum Erstellen einer JGroups-basiertenIClusterConnection
-Implementierungvoid
Disconnects the node from the cluster.void
open()
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:IClusterConnection
Opens this connection. When no node exists yet, a new group is created. Otherwise, when a group exists already, joins that groups.- Specified by:
open
in 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:IClusterConnection
Closes the connection to other nodes. This method closes the entire cluster, so that no more nodes can be added to the group.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIClusterConnection
-
disconnect
public void disconnect()Description copied from interface:IClusterConnection
Disconnects the node from the cluster. The node can join the cluster again later by callingIClusterConnection.open()
.- Specified by:
disconnect
in interfaceIClusterConnection
-
getTopologyObserver
- Specified by:
getTopologyObserver
in 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:
getChannelObserver
in 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:
getMessageObserver
in 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:
getCluster
in interfaceIClusterConnection
- Returns:
- The cluster to
-