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, Mircea.Markus@jboss.com

Method Summary
 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.
 void broadcastRpcCommandInFuture(ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> future)
          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.
 void broadcastRpcCommandInFuture(ReplicableCommand rpc, NotifyingNotifiableFuture<Object> future)
          The same as broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 Address getAddress()
          Returns the address associated with this RpcManager or null if not part of the cluster.
 Transport getTransport()
           
 void invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync)
          Broadcasts an RPC command to a specified set of recipients
 Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue)
          Broadcasts an RPC command to a specified set of recipients
 Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout)
          Invokes an RPC call on other caches in the cluster.
 Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue)
          Invokes an RPC call on other caches in the cluster.
 Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
          Invokes an RPC call on other caches in the cluster.
 void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> future)
          The same as invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> future, long timeout)
          The same as invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture) except that you can specify a timeout.
 void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> future, long timeout, boolean ignoreLeavers)
          The same as invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture, long) except that you can specify a response mode.
 void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, NotifyingNotifiableFuture<Object> future)
          The same as invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean) except that the task is passed to the transport executor and a Future is returned.
 

Method Detail

invokeRemotely

Map<Address,Response> invokeRemotely(Collection<Address> recipients,
                                     ReplicableCommand rpcCommand,
                                     ResponseMode mode,
                                     long timeout,
                                     boolean usePriorityQueue,
                                     ResponseFilter responseFilter)
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 map of responses from each member contacted.

invokeRemotely

Map<Address,Response> invokeRemotely(Collection<Address> recipients,
                                     ReplicableCommand rpcCommand,
                                     ResponseMode mode,
                                     long timeout,
                                     boolean usePriorityQueue)
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.

invokeRemotely

Map<Address,Response> invokeRemotely(Collection<Address> recipients,
                                     ReplicableCommand rpcCommand,
                                     ResponseMode mode,
                                     long timeout)
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 map of responses from each member contacted.
Throws:
Exception - in the event of problems.

broadcastRpcCommand

void broadcastRpcCommand(ReplicableCommand rpc,
                         boolean sync)
                         throws RpcException
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:
RpcException - in the event of problems

broadcastRpcCommand

void broadcastRpcCommand(ReplicableCommand rpc,
                         boolean sync,
                         boolean usePriorityQueue)
                         throws RpcException
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:
RpcException - in the event of problems

broadcastRpcCommandInFuture

void broadcastRpcCommandInFuture(ReplicableCommand rpc,
                                 NotifyingNotifiableFuture<Object> future)
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
future - the future which will be passed back to the user

broadcastRpcCommandInFuture

void broadcastRpcCommandInFuture(ReplicableCommand rpc,
                                 boolean usePriorityQueue,
                                 NotifyingNotifiableFuture<Object> future)
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
future - the future which will be passed back to the user

invokeRemotely

void invokeRemotely(Collection<Address> recipients,
                    ReplicableCommand rpc,
                    boolean sync)
                    throws RpcException
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:
RpcException - in the event of problems

invokeRemotely

Map<Address,Response> invokeRemotely(Collection<Address> recipients,
                                     ReplicableCommand rpc,
                                     boolean sync,
                                     boolean usePriorityQueue)
                                     throws RpcException
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:
RpcException - in the event of problems

invokeRemotelyInFuture

void invokeRemotelyInFuture(Collection<Address> recipients,
                            ReplicableCommand rpc,
                            NotifyingNotifiableFuture<Object> future)
The same as invokeRemotely(java.util.Collection, 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
future - the future which will be passed back to the user

invokeRemotelyInFuture

void invokeRemotelyInFuture(Collection<Address> recipients,
                            ReplicableCommand rpc,
                            boolean usePriorityQueue,
                            NotifyingNotifiableFuture<Object> future)
The same as invokeRemotely(java.util.Collection, 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
future - the future which will be passed back to the user

invokeRemotelyInFuture

void invokeRemotelyInFuture(Collection<Address> recipients,
                            ReplicableCommand rpc,
                            boolean usePriorityQueue,
                            NotifyingNotifiableFuture<Object> future,
                            long timeout)
The same as invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture) except that you can specify a timeout.

Parameters:
recipients - recipients to invoke remote call on
rpc - command to execute remotely
usePriorityQueue - if true, a priority queue is used
future - the future which will be passed back to the user
timeout - after which to give up (in millis)

invokeRemotelyInFuture

void invokeRemotelyInFuture(Collection<Address> recipients,
                            ReplicableCommand rpc,
                            boolean usePriorityQueue,
                            NotifyingNotifiableFuture<Object> future,
                            long timeout,
                            boolean ignoreLeavers)
The same as invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture, long) except that you can specify a response mode.

Parameters:
recipients - recipients to invoke remote call on
rpc - command to execute remotely
usePriorityQueue - if true, a priority queue is used
future - the future which will be passed back to the user
timeout - after which to give up (in millis)
ignoreLeavers - if true, recipients that leave or have already left the cluster are ignored if false, a SuspectException is thrown when a leave is detected

getTransport

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

getAddress

Address getAddress()
Returns the address associated with this RpcManager or null if not part of the cluster.


-->

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