Class Cluster
java.lang.Object
org.jgroups.ReceiverAdapter
com.logicaldoc.enterprise.cluster.Cluster
- All Implemented Interfaces:
org.jgroups.blocks.RequestHandler
,org.jgroups.MembershipListener
,org.jgroups.MessageListener
,org.jgroups.Receiver
public class Cluster
extends org.jgroups.ReceiverAdapter
implements org.jgroups.blocks.RequestHandler
Object representation of a Cluster of LogicalDOC instances
- Since:
- 6.5
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHandler
(String type, PayloadHandler handler) Return the current NodeGets a node by its identifierThe unique identifier of the local nodegetNodes()
Retrieves the list of nodes member of the clusterhandle
(org.jgroups.Message msg) boolean
isActive()
boolean
void
receive
(org.jgroups.Message msg) sendMessage
(Payload payload) Sends a message to all the cluster and waits for the response.void
setChannelFactory
(ChannelFactory channelFactory) void
setConfig
(com.logicaldoc.util.config.ContextProperties config) Methods inherited from class org.jgroups.ReceiverAdapter
block, getState, setState, suspect, unblock, viewAccepted
-
Constructor Details
-
Cluster
public Cluster()
-
-
Method Details
-
isActive
public boolean isActive() -
getLocalNode
Return the current Node- Returns:
- object representation of the node
-
getNode
Gets a node by its identifier- Parameters:
id
- identifier of the node- Returns:
- object representation of the node
-
getNodes
Retrieves the list of nodes member of the cluster- Returns:
- list of all the nodes
-
sendMessage
Sends a message to all the cluster and waits for the response.- Parameters:
payload
- The payload of the message to send- Returns:
- List of all the answers
-
getNodeId
The unique identifier of the local node- Returns:
- identifier of the current node
-
setChannelFactory
-
isCoordinator
public boolean isCoordinator() -
receive
public void receive(org.jgroups.Message msg) - Specified by:
receive
in interfaceorg.jgroups.MessageListener
- Overrides:
receive
in classorg.jgroups.ReceiverAdapter
-
handle
- Specified by:
handle
in interfaceorg.jgroups.blocks.RequestHandler
- Throws:
Exception
-
setConfig
public void setConfig(com.logicaldoc.util.config.ContextProperties config) -
addHandler
-