Package org.infinispan.commands.remote
Class BaseRpcCommand
- java.lang.Object
-
- org.infinispan.commands.remote.BaseRpcCommand
-
- All Implemented Interfaces:
CacheRpcCommand
,ReplicableCommand
- Direct Known Subclasses:
BackupAckCommand
,BackupMultiKeyAckCommand
,BackupWriteCommand
,BaseClusteredReadCommand
,BaseRpcInvokingCommand
,CancelCommand
,CreateCacheCommand
,DistributedExecuteCommand
,ExceptionAckCommand
,InvalidateVersionsCommand
,RecoveryCommand
,RemoveCacheCommand
,RenewBiasCommand
,RetrieveLastAccessCommand
,RevokeBiasCommand
,StateRequestCommand
,StateResponseCommand
,StreamIteratorCloseCommand
,StreamIteratorNextCommand
,StreamRequestCommand
,StreamResponseCommand
,UpdateLastAccessCommand
,XSiteAdminCommand
,XSiteReplicateCommand
public abstract class BaseRpcCommand extends Object implements CacheRpcCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteString
cacheName
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseRpcCommand(ByteString cacheName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBlock()
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.ByteString
getCacheName()
Address
getOrigin()
Get the origin of the commandvoid
setOrigin(Address origin)
Set the origin of the commandString
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, invoke, invokeAsync, isReturnValueExpected, isSuccessful, perform, readFrom, writeTo
-
-
-
-
Field Detail
-
cacheName
protected final ByteString cacheName
-
-
Constructor Detail
-
BaseRpcCommand
protected BaseRpcCommand(ByteString cacheName)
-
-
Method Detail
-
getCacheName
public ByteString getCacheName()
- Specified by:
getCacheName
in interfaceCacheRpcCommand
- Returns:
- the name of the cache that produced this command. This will also be the name of the cache this command is intended for.
-
getOrigin
public Address getOrigin()
Description copied from interface:CacheRpcCommand
Get the origin of the command- Specified by:
getOrigin
in interfaceCacheRpcCommand
-
setOrigin
public void setOrigin(Address origin)
Description copied from interface:CacheRpcCommand
Set the origin of the command- Specified by:
setOrigin
in interfaceCacheRpcCommand
- Specified by:
setOrigin
in interfaceReplicableCommand
- Parameters:
origin
- the sender'sAddress
-
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 interfaceReplicableCommand
- Returns:
true
if the command can block/wait,false
otherwise
-
-