public class CommandsFactoryImpl extends Object implements CommandsFactory
| Constructor and Description |
|---|
CommandsFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
ApplyDeltaCommand |
buildApplyDeltaCommand(Object deltaAwareValueKey,
Delta delta,
Collection keys)
Builds a ApplyDeltaCommand used for applying Delta objects to DeltaAware containers stored in cache
|
ClearCommand |
buildClearCommand(Set<Flag> flags)
Builds a ClearCommand
|
ClusteredGetCommand |
buildClusteredGetCommand(Object key,
Set<Flag> flags,
boolean acquireRemoteLock,
GlobalTransaction gtx)
Builds a ClusteredGetCommand, which is a remote lookup command
|
CommitCommand |
buildCommitCommand(GlobalTransaction gtx)
Builds a CommitCommand
|
CompleteTransactionCommand |
buildCompleteTransactionCommand(Xid xid,
boolean commit)
Builds a CompleteTransactionCommand command.
|
<T> DistributedExecuteCommand<T> |
buildDistributedExecuteCommand(Callable<T> callable,
Address sender,
Collection keys)
Builds a DistributedExecuteCommand used for migration and execution of distributed Callables and Runnables.
|
EntrySetCommand |
buildEntrySetCommand()
Builds a EntrySetCommand
|
EvictCommand |
buildEvictCommand(Object key)
Builds an EvictCommand
|
GetInDoubtTransactionsCommand |
buildGetInDoubtTransactionsCommand()
Builds a
GetInDoubtTransactionsCommand. |
GetInDoubtTxInfoCommand |
buildGetInDoubtTxInfoCommand() |
GetKeyValueCommand |
buildGetKeyValueCommand(Object key,
Set<Flag> flags)
Builds a GetKeyValueCommand
|
InvalidateCommand |
buildInvalidateCommand(Object... keys)
Builds an InvalidateCommand
|
InvalidateCommand |
buildInvalidateFromL1Command(Address origin,
boolean forRehash,
Collection<Object> keys) |
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Collection<Object> keys)
Builds an InvalidateFromL1Command
|
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Object... keys)
Builds an InvalidateFromL1Command
|
KeySetCommand |
buildKeySetCommand()
Builds a KeySetCommand
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags) |
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags,
GlobalTransaction gtx)
Builds a LockControlCommand to control explicit remote locking
|
LockControlCommand |
buildLockControlCommand(Object key,
Set<Flag> flags,
GlobalTransaction gtx)
Same as
CommandsFactory.buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys. |
MapReduceCommand |
buildMapReduceCommand(Mapper m,
Reducer r,
Address sender,
Collection keys)
Builds a MapReduceCommand used for migration and execution of MapReduce tasks.
|
PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhaseCommit)
Builds a PrepareCommand
|
PutKeyValueCommand |
buildPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutKeyValueCommand
|
PutMapCommand |
buildPutMapCommand(Map<?,?> map,
long lifespan,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutMapCommand
|
RemoveCommand |
buildRemoveCommand(Object key,
Object value,
Set<Flag> flags)
Builds a RemoveCommand
|
ReplaceCommand |
buildReplaceCommand(Object key,
Object oldValue,
Object newValue,
long lifespan,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a ReplaceCommand
|
MultipleRpcCommand |
buildReplicateCommand(List<ReplicableCommand> toReplicate)
Builds an RpcCommand "envelope" containing multiple ReplicableCommands
|
RollbackCommand |
buildRollbackCommand(GlobalTransaction gtx)
Builds a RollbackCommand
|
SingleRpcCommand |
buildSingleRpcCommand(ReplicableCommand call)
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommand
|
SizeCommand |
buildSizeCommand()
Builds a SizeCommand
|
StateTransferControlCommand |
buildStateTransferCommand(StateTransferControlCommand.Type type,
Address sender,
int viewId)
Builds a RehashControlCommand for coordinating a rehash event.
|
StateTransferControlCommand |
buildStateTransferCommand(StateTransferControlCommand.Type type,
Address sender,
int viewId,
Collection<InternalCacheEntry> state,
Collection<LockInfo> lockInfo)
Builds a RehashControlCommand for coordinating a rehash event.
|
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(long internalId) |
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(Xid xid,
GlobalTransaction globalTransaction)
Builds a
TxCompletionNotificationCommand. |
ValuesCommand |
buildValuesCommand()
Builds a ValuesCommand
|
VersionedCommitCommand |
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommand
|
VersionedPrepareCommand |
buildVersionedPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhase)
Builds a VersionedPrepareCommand
|
VersionedPutKeyValueCommand |
buildVersionedPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis,
EntryVersion version,
Set<Flag> flags)
Builds a special form of
PutKeyValueCommand that also holds a reference to a version to be applied. |
String |
getCacheName()
Retrieves the cache name this CommandFactory is set up to construct commands for.
|
void |
initializeReplicableCommand(ReplicableCommand c,
boolean isRemote)
Initializes a
ReplicableCommand read from a data stream with components specific
to the target cache instance. |
void |
setupDependencies(DataContainer container,
CacheNotifier notifier,
Cache<Object,Object> cache,
InterceptorChain interceptorChain,
DistributionManager distributionManager,
InvocationContextContainer icc,
TransactionTable txTable,
Configuration configuration,
Map<Byte,ModuleCommandInitializer> moduleCommandInitializers,
RecoveryManager recoveryManager,
StateTransferManager stateTransferManager,
LockManager lockManager,
InternalEntryFactory entryFactory) |
void |
start() |
public void setupDependencies(DataContainer container, CacheNotifier notifier, Cache<Object,Object> cache, InterceptorChain interceptorChain, DistributionManager distributionManager, InvocationContextContainer icc, TransactionTable txTable, Configuration configuration, Map<Byte,ModuleCommandInitializer> moduleCommandInitializers, RecoveryManager recoveryManager, StateTransferManager stateTransferManager, LockManager lockManager, InternalEntryFactory entryFactory)
public void start()
public PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactorybuildPutKeyValueCommand in interface CommandsFactorykey - key to putvalue - value to putlifespanMillis - lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis - max idle time in milliseconds. -1 if maxIdle is not used.public VersionedPutKeyValueCommand buildVersionedPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, EntryVersion version, Set<Flag> flags)
CommandsFactoryPutKeyValueCommand that also holds a reference to a version to be applied.buildVersionedPutKeyValueCommand in interface CommandsFactorykey - key to putvalue - value to putlifespanMillis - lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis - max idle time in milliseconds. -1 if maxIdle is not used.version - version to apply with this putpublic RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags)
CommandsFactorybuildRemoveCommand in interface CommandsFactorykey - key to removevalue - value to check for ina conditional remove, or null for an unconditional remove.public InvalidateCommand buildInvalidateCommand(Object... keys)
CommandsFactorybuildInvalidateCommand in interface CommandsFactorykeys - keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Object... keys)
CommandsFactorybuildInvalidateFromL1Command in interface CommandsFactoryforRehash - set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys - keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Collection<Object> keys)
CommandsFactorybuildInvalidateFromL1Command in interface CommandsFactoryforRehash - set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys - keys to invalidatepublic InvalidateCommand buildInvalidateFromL1Command(Address origin, boolean forRehash, Collection<Object> keys)
public ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, long lifespan, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactorybuildReplaceCommand in interface CommandsFactorykey - key to replaceoldValue - existing value to check for if conditional, null if unconditional.newValue - value to replace withlifespan - lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis - max idle time in milliseconds. -1 if maxIdle is not used.public SizeCommand buildSizeCommand()
CommandsFactorybuildSizeCommand in interface CommandsFactorypublic KeySetCommand buildKeySetCommand()
CommandsFactorybuildKeySetCommand in interface CommandsFactorypublic ValuesCommand buildValuesCommand()
CommandsFactorybuildValuesCommand in interface CommandsFactorypublic EntrySetCommand buildEntrySetCommand()
CommandsFactorybuildEntrySetCommand in interface CommandsFactorypublic GetKeyValueCommand buildGetKeyValueCommand(Object key, Set<Flag> flags)
CommandsFactorybuildGetKeyValueCommand in interface CommandsFactorykey - key to getpublic PutMapCommand buildPutMapCommand(Map<?,?> map, long lifespan, long maxIdleTimeMillis, Set<Flag> flags)
CommandsFactorybuildPutMapCommand in interface CommandsFactorymap - map containing key/value entries to putlifespan - lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis - max idle time in milliseconds. -1 if maxIdle is not used.public ClearCommand buildClearCommand(Set<Flag> flags)
CommandsFactorybuildClearCommand in interface CommandsFactorypublic EvictCommand buildEvictCommand(Object key)
CommandsFactorybuildEvictCommand in interface CommandsFactorykey - key to evictpublic PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
CommandsFactorybuildPrepareCommand in interface CommandsFactorygtx - global transaction associated with the preparemodifications - list of modificationsonePhaseCommit - is this a one-phase or two-phase transaction?public VersionedPrepareCommand buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
CommandsFactorybuildVersionedPrepareCommand in interface CommandsFactorygtx - global transaction associated with the preparemodifications - list of modificationspublic CommitCommand buildCommitCommand(GlobalTransaction gtx)
CommandsFactorybuildCommitCommand in interface CommandsFactorygtx - global transaction associated with the commitpublic VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
CommandsFactorybuildVersionedCommitCommand in interface CommandsFactorygtx - global transaction associated with the commitpublic RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
CommandsFactorybuildRollbackCommand in interface CommandsFactorygtx - global transaction associated with the rollbackpublic MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
CommandsFactorybuildReplicateCommand in interface CommandsFactorytoReplicate - ReplicableCommands to include in the envelopepublic SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
CommandsFactorybuildSingleRpcCommand in interface CommandsFactorycall - ReplicableCommand to include in the envelopepublic ClusteredGetCommand buildClusteredGetCommand(Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx)
CommandsFactorybuildClusteredGetCommand in interface CommandsFactorykey - key to look uppublic void initializeReplicableCommand(ReplicableCommand c, boolean isRemote)
CommandsFactoryReplicableCommand read from a data stream with components specific
to the target cache instance.
Implementations should also be deep, in that if the command contains other commands, these should be recursed
into.
initializeReplicableCommand in interface CommandsFactoryisRemote - true if the command is deserialized and is executed remote.c - command to initialize. Cannot be null.public LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags, GlobalTransaction gtx)
CommandsFactorybuildLockControlCommand in interface CommandsFactorykeys - keys to lockpublic LockControlCommand buildLockControlCommand(Object key, Set<Flag> flags, GlobalTransaction gtx)
CommandsFactoryCommandsFactory.buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys.buildLockControlCommand in interface CommandsFactorypublic LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags)
buildLockControlCommand in interface CommandsFactorypublic StateTransferControlCommand buildStateTransferCommand(StateTransferControlCommand.Type type, Address sender, int viewId)
CommandsFactorybuildStateTransferCommand in interface CommandsFactorytype - type of RehashControlCommandsender - sender's AddressviewId - the last view id on the senderpublic StateTransferControlCommand buildStateTransferCommand(StateTransferControlCommand.Type type, Address sender, int viewId, Collection<InternalCacheEntry> state, Collection<LockInfo> lockInfo)
CommandsFactorybuildStateTransferCommand in interface CommandsFactorypublic String getCacheName()
CommandsFactorygetCacheName in interface CommandsFactorypublic GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
CommandsFactoryGetInDoubtTransactionsCommand.buildGetInDoubtTransactionsCommand in interface CommandsFactorypublic TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
CommandsFactoryTxCompletionNotificationCommand.buildTxCompletionNotificationCommand in interface CommandsFactorypublic TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
buildTxCompletionNotificationCommand in interface CommandsFactoryinternalId - the internal id identifying the transaction to be removed.TxCompletionNotificationCommandpublic <T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
CommandsFactorybuildDistributedExecuteCommand in interface CommandsFactorycallable - the callable tasksender - sender's Addresskeys - keys used in Callablepublic MapReduceCommand buildMapReduceCommand(Mapper m, Reducer r, Address sender, Collection keys)
CommandsFactorybuildMapReduceCommand in interface CommandsFactorym - Mapper for MapReduceTaskr - Reducer for MapReduceTasksender - sender's Addresskeys - keys used in MapReduceTaskpublic GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
buildGetInDoubtTxInfoCommand in interface CommandsFactoryGetInDoubtTxInfoCommandpublic CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
CommandsFactorybuildCompleteTransactionCommand in interface CommandsFactoryxid - the xid identifying the transaction we want to complete.commit - commit(true) or rollback(false)?public ApplyDeltaCommand buildApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection keys)
CommandsFactorybuildApplyDeltaCommand in interface CommandsFactoryApplyDeltaCommandCopyright © 2012 JBoss by Red Hat. All Rights Reserved.