Package de.xima.fc.cluster.impl.jgroup
Class JGroupsCluster
- java.lang.Object
-
- de.xima.fc.cluster.impl.jgroup.JGroupsCluster
-
- All Implemented Interfaces:
ICluster,Serializable
public class JGroupsCluster extends Object implements ICluster
Implementation of aIClusterthat usesEClusterImplementation.JGROUPS.- Since:
- 3.1.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JGroupsCluster(org.jgroups.JChannel channel, JGroupsClusterConnection clusterConnection)Creates a new JGroups cluster implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeLocaleNodeState(ENodeState state)Changes the state of the local node, i.e. the node that corresponds to the server running this code.<K extends Serializable,V extends Serializable>
Map<K,V>createReplicatedMap(@NotNull ReplicatedMapConfig mapConfig)StringgetID()NodeModelgetLocaleNode()String[]getNodeIDs()List<NodeModel>getNodeList()voidsendMessage(IClusterMessage msg)Attempts to send a message to other nodes in the cluster.
-
-
-
Constructor Detail
-
JGroupsCluster
public JGroupsCluster(org.jgroups.JChannel channel, JGroupsClusterConnection clusterConnection)Creates a new JGroups cluster implementation.- Parameters:
channel- Channel to use for the local node.
-
-
Method Detail
-
getID
public String getID()
-
getNodeList
public List<NodeModel> getNodeList()
- Specified by:
getNodeListin interfaceICluster- Returns:
- All nodes that are part of the cluster, whether they are currently connected.
-
getNodeIDs
public String[] getNodeIDs()
- Specified by:
getNodeIDsin interfaceICluster- Returns:
- A list of the IDs of all nodes that are part of the cluster, whether they are currently connected.
-
sendMessage
public void sendMessage(IClusterMessage msg) throws Exception
Description copied from interface:IClusterAttempts to send a message to other nodes in the cluster.- Specified by:
sendMessagein interfaceICluster- Parameters:
msg- Message to send to other nodes.- Throws:
Exception- When the message could not be sent, such as due to network failures.
-
createReplicatedMap
public <K extends Serializable,V extends Serializable> Map<K,V> createReplicatedMap(@NotNull @NotNull ReplicatedMapConfig mapConfig) throws Exception
- Specified by:
createReplicatedMapin interfaceICluster- Throws:
Exception
-
getLocaleNode
public NodeModel getLocaleNode()
- Specified by:
getLocaleNodein interfaceICluster- Returns:
- The local node, i.e. the node that corresponds to the server running this code.
-
changeLocaleNodeState
public void changeLocaleNodeState(ENodeState state)
Description copied from interface:IClusterChanges the state of the local node, i.e. the node that corresponds to the server running this code.- Specified by:
changeLocaleNodeStatein interfaceICluster- Parameters:
state- The new state for the node.
-
-