public interface RPCService
| Modifier and Type | Field and Description |
|---|---|
static RuntimePermission |
ACCESS_RPC_SERVICE_PERMISSION
The permission needed to access to any methods of the RPCService
|
| Modifier and Type | Method and Description |
|---|---|
List<Object> |
executeCommandOnAllNodes(RemoteCommand command,
boolean synchronous,
Serializable... args)
Executes a command on all the cluster nodes.
|
List<Object> |
executeCommandOnAllNodes(RemoteCommand command,
long timeout,
Serializable... args)
Executes a command synchronously on all the cluster nodes.
|
Object |
executeCommandOnCoordinator(RemoteCommand command,
boolean synchronous,
Serializable... args)
Executes a command on the coordinator only.
|
Object |
executeCommandOnCoordinator(RemoteCommand command,
long timeout,
Serializable... args)
Executes a command synchronously on the coordinator only.
|
boolean |
isCoordinator()
Indicates whether the local node is the coordinator of the cluster
|
RemoteCommand |
registerCommand(RemoteCommand command)
Register a new
RemoteCommand instance, it will be mapped to its id. |
void |
registerTopologyChangeListener(TopologyChangeListener listener)
Register a new
TopologyChangeListener |
void |
unregisterCommand(RemoteCommand command)
Unregister a
RemoteCommand instance, if the id is known or the instance itself is known
otherwise it will be ignored |
void |
unregisterTopologyChangeListener(TopologyChangeListener listener)
Unregister a
TopologyChangeListener if it exists |
static final RuntimePermission ACCESS_RPC_SERVICE_PERMISSION
List<Object> executeCommandOnAllNodes(RemoteCommand command, boolean synchronous, Serializable... args) throws RPCException, SecurityException
RPCException will be thrown.command - The command to execute on each cluster nodesynchronous - if true, sets group request mode to org.jgroups.blocks.GroupRequest#GET_ALL,
and if false sets it to org.jgroups.blocks.GroupRequest#GET_NONE.args - an array of Serializable objects corresponding to parameters of the command
to execute remotelyRPCException - in the event of problems.SecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONList<Object> executeCommandOnAllNodes(RemoteCommand command, long timeout, Serializable... args) throws RPCException, SecurityException
RPCException will be thrown.command - The command to execute on each cluster nodetimeout - a timeout after which to throw a replication exception.args - an array of Serializable objects corresponding to parameters of the command
to execute remotelyRPCException - in the event of problems.SecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONObject executeCommandOnCoordinator(RemoteCommand command, boolean synchronous, Serializable... args) throws RPCException, SecurityException
RPCException will be thrown.command - The command to execute on the coordinator nodesynchronous - if true, sets group request mode to org.jgroups.blocks.GroupRequest#GET_ALL,
and if false sets it to org.jgroups.blocks.GroupRequest#GET_NONE.args - an array of Serializable objects corresponding to parameters of the command
to execute remotelyRPCException - in the event of problems.SecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONObject executeCommandOnCoordinator(RemoteCommand command, long timeout, Serializable... args) throws RPCException, SecurityException
RPCException will be thrown.command - The command to execute on the coordinator nodetimeout - a timeout after which to throw a replication exception.args - an array of Serializable objects corresponding to parameters of the command
to execute remotelyRPCException - in the event of problems.SecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONRemoteCommand registerCommand(RemoteCommand command) throws SecurityException
RemoteCommand instance, it will be mapped to its id. If a command with the
same Id has already been registered, a warning will be printed into the log file and the new
command will replace the old one.command - the instance of the RemoteCommand to registerSecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONvoid unregisterCommand(RemoteCommand command) throws SecurityException
RemoteCommand instance, if the id is known or the instance itself is known
otherwise it will be ignoredcommand - the command to unregisterSecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONboolean isCoordinator()
throws RPCException
true if the coordinator is the coordinator, false otherwise
throws RPCException in case the RPCService is in an illegal stateRPCExceptionvoid registerTopologyChangeListener(TopologyChangeListener listener) throws SecurityException
TopologyChangeListenerlistener - the listener to be registeredSecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONvoid unregisterTopologyChangeListener(TopologyChangeListener listener) throws SecurityException
TopologyChangeListener if it existslistener - the listener to unregisterSecurityException - if the SecurityManager is installed and the call method
doesn't have the RuntimePermission ACCESS_RPC_SERVICE_PERMISSIONCopyright © 2021 eXo Platform SAS. All Rights Reserved.