org.infinispan.commands.remote
Class BaseRpcCommand

java.lang.Object
  extended by org.infinispan.commands.remote.BaseRpcCommand
All Implemented Interfaces:
CacheRpcCommand, ReplicableCommand
Direct Known Subclasses:
BaseRpcInvokingCommand, CancelCommand, ClusteredGetCommand, ClusteredQueryCommand, CreateCacheCommand, DistributedExecuteCommand, IndexUpdateCommand, MapCombineCommand, RecoveryCommand, ReduceCommand, RemoveCacheCommand, StateRequestCommand, StateResponseCommand, XSiteAdminCommand

public abstract class BaseRpcCommand
extends Object
implements CacheRpcCommand


Field Summary
protected  String cacheName
           
 
Constructor Summary
protected BaseRpcCommand(String cacheName)
           
 
Method Summary
 boolean canBlock()
          If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.
 String getCacheName()
           
 Address getOrigin()
          Get the origin of the command
 void setOrigin(Address origin)
          Set the origin of the command
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.commands.ReplicableCommand
getCommandId, getParameters, isReturnValueExpected, perform, setParameters
 

Field Detail

cacheName

protected final String cacheName
Constructor Detail

BaseRpcCommand

protected BaseRpcCommand(String cacheName)
Method Detail

getCacheName

public String getCacheName()
Specified by:
getCacheName in interface CacheRpcCommand
Returns:
the name of the cache that produced this command. This will also be the name of the cache this command is intended for.

toString

public String toString()
Overrides:
toString in class Object

getOrigin

public Address getOrigin()
Description copied from interface: CacheRpcCommand
Get the origin of the command

Specified by:
getOrigin in interface CacheRpcCommand
Returns:

setOrigin

public void setOrigin(Address origin)
Description copied from interface: CacheRpcCommand
Set the origin of the command

Specified by:
setOrigin in interface CacheRpcCommand

canBlock

public boolean canBlock()
Description copied from interface: ReplicableCommand
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool. Otherwise, the command is processed directly in the JGroups thread.

This feature allows to avoid keep a JGroups thread busy that can originate discard of messages and retransmissions. So, the commands that can block (waiting for some state, acquiring locks, etc.) should return true.

Specified by:
canBlock in interface ReplicableCommand
Returns:
true if the command can block/wait, false otherwise

-->

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