org.infinispan.remoting.rpc
Interface RpcManager

All Known Implementing Classes:
RpcManagerImpl

public interface RpcManager

Provides a mechanism for communicating with other caches in the cluster, by formatting and passing requests down to the registered Transport.

Since:
4.0
Author:
Manik Surtani

Method Summary
 void anycastRpcCommand(List<Address> recipients, ReplicableCommand rpc, boolean sync)
          Broadcasts an RPC command to a specified set of recipients
 void anycastRpcCommand(List<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue)
          Broadcasts an RPC command to a specified set of recipients
 Future<Object> anycastRpcCommandInFuture(List<Address> recipients, ReplicableCommand rpc)
          The same as anycastRpcCommand(java.util.List, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 Future<Object> anycastRpcCommandInFuture(List<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue)
          The same as anycastRpcCommand(java.util.List, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 void broadcastRpcCommand(ReplicableCommand rpc, boolean sync)
          Broadcasts an RPC command to the entire cluster.
 void broadcastRpcCommand(ReplicableCommand rpc, boolean sync, boolean usePriorityQueue)
          Broadcasts an RPC command to the entire cluster.
 Future<Object> broadcastRpcCommandInFuture(ReplicableCommand rpc)
          The same as broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 Future<Object> broadcastRpcCommandInFuture(ReplicableCommand rpc, boolean usePriorityQueue)
          The same as broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean, boolean) except that the task is passed to the transport executor and a Future is returned.
 Address getCurrentStateTransferSource()
          If retrieveState(String, long) has been invoked and hasn't yet returned (i.e., a state transfer is in progress), this method will return the current Address from which a state transfer is being attempted.
 Transport getTransport()
           
 List<Response> invokeRemotely(List<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout)
          Invokes an RPC call on other caches in the cluster.
 List<Response> invokeRemotely(List<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue)
          Invokes an RPC call on other caches in the cluster.
 List<Response> invokeRemotely(List<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
          Invokes an RPC call on other caches in the cluster.
 void retrieveState(String cacheName, long timeout)
          Initiates a state retrieval process from neighbouring caches.
 

Method Detail

invokeRemotely

List<Response> invokeRemotely(List<Address> recipients,
                              ReplicableCommand rpcCommand,
                              ResponseMode mode,
                              long timeout,
                              boolean usePriorityQueue,
                              ResponseFilter responseFilter)
                              throws Exception
Invokes an RPC call on other caches in the cluster.

Parameters:
recipients - a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
rpcCommand - the cache command to invoke
mode - the response mode to use
timeout - a timeout after which to throw a replication exception.
usePriorityQueue - if true, a priority queue is used to deliver messages. May not be supported by all implementations.
responseFilter - a response filter with which to filter out failed/unwanted/invalid responses.
Returns:
a list of responses from each member contacted.
Throws:
Exception - in the event of problems.

invokeRemotely

List<Response> invokeRemotely(List<Address> recipients,
                              ReplicableCommand rpcCommand,
                              ResponseMode mode,
                              long timeout,
                              boolean usePriorityQueue)
                              throws Exception
Invokes an RPC call on other caches in the cluster.

Parameters:
recipients - a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
rpcCommand - the cache command to invoke
mode - the response mode to use
timeout - a timeout after which to throw a replication exception.
usePriorityQueue - if true, a priority queue is used to deliver messages. May not be supported by all implementations.
Returns:
a list of responses from each member contacted.
Throws:
Exception - in the event of problems.

invokeRemotely

List<Response> invokeRemotely(List<Address> recipients,
                              ReplicableCommand rpcCommand,
                              ResponseMode mode,
                              long timeout)
                              throws Exception
Invokes an RPC call on other caches in the cluster.

Parameters:
recipients - a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
rpcCommand - the cache command to invoke
mode - the response mode to use
timeout - a timeout after which to throw a replication exception.
Returns:
a list of responses from each member contacted.
Throws:
Exception - in the event of problems.

retrieveState

void retrieveState(String cacheName,
                   long timeout)
                   throws StateTransferException
Initiates a state retrieval process from neighbouring caches. This method will block until it either times out, or state is retrieved and applied.

Parameters:
cacheName - name of cache requesting state
timeout - length of time to try to retrieve state on each peer
Throws:
StateTransferException - in the event of problems

broadcastRpcCommand

void broadcastRpcCommand(ReplicableCommand rpc,
                         boolean sync)
                         throws ReplicationException
Broadcasts an RPC command to the entire cluster.

Parameters:
rpc - command to execute remotely
sync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.
Throws:
ReplicationException - in the event of problems

broadcastRpcCommand

void broadcastRpcCommand(ReplicableCommand rpc,
                         boolean sync,
                         boolean usePriorityQueue)
                         throws ReplicationException
Broadcasts an RPC command to the entire cluster.

Parameters:
rpc - command to execute remotely
sync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.
usePriorityQueue - if true, a priority queue is used
Throws:
ReplicationException - in the event of problems

broadcastRpcCommandInFuture

Future<Object> broadcastRpcCommandInFuture(ReplicableCommand rpc)
The same as broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned. The transport always deals with this synchronously.

Parameters:
rpc - command to execute remotely
Returns:
a future

broadcastRpcCommandInFuture

Future<Object> broadcastRpcCommandInFuture(ReplicableCommand rpc,
                                           boolean usePriorityQueue)
The same as broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean, boolean) except that the task is passed to the transport executor and a Future is returned. The transport always deals with this synchronously.

Parameters:
rpc - command to execute remotely
usePriorityQueue - if true, a priority queue is used
Returns:
a future

anycastRpcCommand

void anycastRpcCommand(List<Address> recipients,
                       ReplicableCommand rpc,
                       boolean sync)
                       throws ReplicationException
Broadcasts an RPC command to a specified set of recipients

Parameters:
recipients - recipients to invoke remote command on
rpc - command to execute remotely
sync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.
Throws:
ReplicationException - in the event of problems

anycastRpcCommand

void anycastRpcCommand(List<Address> recipients,
                       ReplicableCommand rpc,
                       boolean sync,
                       boolean usePriorityQueue)
                       throws ReplicationException
Broadcasts an RPC command to a specified set of recipients

Parameters:
recipients - recipients to invoke remote command on
rpc - command to execute remotely
sync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.
usePriorityQueue - if true, a priority queue is used
Throws:
ReplicationException - in the event of problems

anycastRpcCommandInFuture

Future<Object> anycastRpcCommandInFuture(List<Address> recipients,
                                         ReplicableCommand rpc)
The same as anycastRpcCommand(java.util.List, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned. The transport always deals with this synchronously.

Parameters:
recipients - recipients to invoke remote call on
rpc - command to execute remotely
Returns:
a future

anycastRpcCommandInFuture

Future<Object> anycastRpcCommandInFuture(List<Address> recipients,
                                         ReplicableCommand rpc,
                                         boolean usePriorityQueue)
The same as anycastRpcCommand(java.util.List, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned. The transport always deals with this synchronously.

Parameters:
recipients - recipients to invoke remote call on
rpc - command to execute remotely
usePriorityQueue - if true, a priority queue is used
Returns:
a future

getTransport

Transport getTransport()
Returns:
a reference to the underlying transport.

getCurrentStateTransferSource

Address getCurrentStateTransferSource()
If retrieveState(String, long) has been invoked and hasn't yet returned (i.e., a state transfer is in progress), this method will return the current Address from which a state transfer is being attempted. Otherwise, this method returns a null.

Returns:
the current Address from which a state transfer is being attempted, if a state transfer is in progress, or a null otherwise.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.