public class RpcManagerImpl extends Object implements RpcManager
Transport implementation,
and is used to set up the transport and provide lifecycle and dependency hooks into external transport
implementations.| Constructor and Description |
|---|
RpcManagerImpl() |
public void injectDependencies(Transport t, Configuration configuration, ReplicationQueue replicationQueue, CommandsFactory cf, ExecutorService e, CacheViewsManager cvm)
public String getCommittedViewAsString()
public String getPendingViewAsString()
public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
RpcManagerinvokeRemotely in interface RpcManagerrecipients - 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 invokemode - the response mode to usetimeout - 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.public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue)
RpcManagerinvokeRemotely in interface RpcManagerrecipients - 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 invokemode - the response mode to usetimeout - 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.public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout)
RpcManagerinvokeRemotely in interface RpcManagerrecipients - 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 invokemode - the response mode to usetimeout - a timeout after which to throw a replication exception.public final void broadcastRpcCommand(ReplicableCommand rpc, boolean sync) throws RpcException
RpcManagerbroadcastRpcCommand in interface RpcManagerrpc - command to execute remotelysync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.RpcException - in the event of problemspublic final void broadcastRpcCommand(ReplicableCommand rpc, boolean sync, boolean usePriorityQueue) throws RpcException
RpcManagerbroadcastRpcCommand in interface RpcManagerrpc - command to execute remotelysync - if true, the transport will operate in sync mode. Otherwise, it will operate in async
mode.usePriorityQueue - if true, a priority queue is usedRpcException - in the event of problemspublic final void broadcastRpcCommandInFuture(ReplicableCommand rpc, NotifyingNotifiableFuture<Object> l)
RpcManagerRpcManager.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.broadcastRpcCommandInFuture in interface RpcManagerrpc - command to execute remotelyl - the future which will be passed back to the userpublic final void broadcastRpcCommandInFuture(ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l)
RpcManagerRpcManager.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.broadcastRpcCommandInFuture in interface RpcManagerrpc - command to execute remotelyusePriorityQueue - if true, a priority queue is usedl - the future which will be passed back to the userpublic final void invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync) throws RpcException
RpcManagerinvokeRemotely in interface RpcManagerrecipients - recipients to invoke remote command onrpc - command to execute remotelysync - if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.RpcException - in the event of problemspublic final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue) throws RpcException
RpcManagerinvokeRemotely in interface RpcManagerrecipients - recipients to invoke remote command onrpc - command to execute remotelysync - if true, the transport will operate in sync mode. Otherwise, it will operate in async
mode.usePriorityQueue - if true, a priority queue is usedRpcException - in the event of problemspublic final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue, long timeout) throws RpcException
RpcExceptionpublic final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, NotifyingNotifiableFuture<Object> l)
RpcManagerRpcManager.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.invokeRemotelyInFuture in interface RpcManagerrecipients - recipients to invoke remote call onrpc - command to execute remotelyl - the future which will be passed back to the userpublic final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l)
RpcManagerRpcManager.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.invokeRemotelyInFuture in interface RpcManagerrecipients - recipients to invoke remote call onrpc - command to execute remotelyusePriorityQueue - if true, a priority queue is usedl - the future which will be passed back to the userpublic final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l, long timeout)
RpcManagerRpcManager.invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture) except that you can specify a timeout.invokeRemotelyInFuture in interface RpcManagerrecipients - recipients to invoke remote call onrpc - command to execute remotelyusePriorityQueue - if true, a priority queue is usedl - the future which will be passed back to the usertimeout - after which to give up (in millis)public void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l, long timeout, boolean ignoreLeavers)
RpcManagerRpcManager.invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture, long) except that you can specify a response mode.invokeRemotelyInFuture in interface RpcManagerrecipients - recipients to invoke remote call onrpc - command to execute remotelyusePriorityQueue - if true, a priority queue is usedl - the future which will be passed back to the usertimeout - 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 detectedpublic Transport getTransport()
getTransport in interface RpcManagerpublic void resetStatistics()
public long getReplicationCount()
public long getReplicationFailures()
public boolean isStatisticsEnabled()
public void setStatisticsEnabled(boolean statisticsEnabled)
public String getSuccessRatio()
public double getSuccessRatioFloatingPoint()
public long getAverageReplicationTime()
public void setTransport(Transport t)
public Address getAddress()
RpcManagergetAddress in interface RpcManagerCopyright © 2012 JBoss by Red Hat. All Rights Reserved.