org.jboss.cache.factories
Class CommandsFactory

java.lang.Object
  extended by org.jboss.cache.factories.CommandsFactory

public class CommandsFactory
extends Object

Factory for all types of cache commands. Here are some of the purposes of this class:

   - not creating CacheCommands directly (i.e. through new usage) as this would reduce unit testability
   - reduce the coupling between commands and other components. e.g. considering a commands that needs to knwo whether
     locking type is optimistic, we will pass in a 'optimistic' boolean flag rather than entire Configuration object
 

Since:
2.2
Author:
Mircea.Markus@jboss.com

Constructor Summary
CommandsFactory()
           
 
Method Summary
 AnnounceBuddyPoolNameCommand buildAnnounceBuddyPoolNameCommand(org.jgroups.Address address, String buddyPoolName)
           
 AssignToBuddyGroupCommand buildAssignToBuddyGroupCommand(BuddyGroup group, Map<Fqn,byte[]> state)
           
 ClearDataCommand buildClearDataCommand(GlobalTransaction gtx, Fqn fqn)
           
 ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
           
 CommitCommand buildCommitCommand(GlobalTransaction gtx)
           
 CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
           
 DataGravitationCleanupCommand buildDataGravitationCleanupCommand(Fqn primaryFqn, Fqn backupFqn)
           
 EvictCommand buildEvictFqnCommand(Fqn fqn)
           
 ExistsCommand buildExistsNodeCommand(Fqn fqn)
           
 GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn)
           
 GetDataMapCommand buildGetDataMapCommand(Fqn fqn)
           
 GetKeysCommand buildGetKeysCommand(Fqn fqn)
           
 GetKeyValueCommand buildGetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent)
           
 GetNodeCommand buildGetNodeCommand(Fqn fqn)
           
 GravitateDataCommand buildGravitateDataCommand(Fqn fqn, Boolean searchSubtrees)
           
 InvalidateCommand buildInvalidateCommand(Fqn fqn)
           
 MoveCommand buildMoveCommand(Fqn from, Fqn to)
           
 OptimisticPrepareCommand buildOptimisticPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Map data, org.jgroups.Address address, boolean onePhaseCommit)
           
 PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, org.jgroups.Address address, boolean onePhaseCommit)
           
 PrepareCommand buildPrepareCommand(GlobalTransaction gtx, ReversibleCommand command, boolean onePhaseCommit)
           
 PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data)
           
 PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
           
 PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
           
 RemoveFromBuddyGroupCommand buildRemoveFromBuddyGroupCommand(String groupName)
           
 RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key)
           
 RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn)
           
 ReplicateCommand buildReplicateCommand(List<ReplicableCommand> modifications)
           
 ReplicateCommand buildReplicateCommand(ReplicableCommand command)
           
 RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
           
 ReplicableCommand fromStream(int id, Object[] parameters)
          Builds a cache command based on the ID passed in and an object array of parameters
 void initialize(RPCManager rpc, DataContainer dataContainer, Notifier notifier, BuddyManager buddyManager, InterceptorChain invoker, TransactionTable transactionTable, CacheSPI cacheSpi, Configuration configuration, TransactionManager txManager, BuddyFqnTransformer buddyFqnTransformer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandsFactory

public CommandsFactory()
Method Detail

initialize

public void initialize(RPCManager rpc,
                       DataContainer dataContainer,
                       Notifier notifier,
                       BuddyManager buddyManager,
                       InterceptorChain invoker,
                       TransactionTable transactionTable,
                       CacheSPI cacheSpi,
                       Configuration configuration,
                       TransactionManager txManager,
                       BuddyFqnTransformer buddyFqnTransformer)

buildPutDataMapCommand

public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx,
                                                Fqn fqn,
                                                Map data)

buildPutKeyValueCommand

public PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx,
                                                  Fqn fqn,
                                                  Object key,
                                                  Object value)

buildPutForExternalReadCommand

public PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx,
                                                                Fqn fqn,
                                                                Object key,
                                                                Object value)

buildReplicateCommand

public ReplicateCommand buildReplicateCommand(ReplicableCommand command)

buildReplicateCommand

public ReplicateCommand buildReplicateCommand(List<ReplicableCommand> modifications)

buildPrepareCommand

public PrepareCommand buildPrepareCommand(GlobalTransaction gtx,
                                          ReversibleCommand command,
                                          boolean onePhaseCommit)

buildPrepareCommand

public PrepareCommand buildPrepareCommand(GlobalTransaction gtx,
                                          List<ReversibleCommand> modifications,
                                          org.jgroups.Address address,
                                          boolean onePhaseCommit)

buildCommitCommand

public CommitCommand buildCommitCommand(GlobalTransaction gtx)

buildDataGravitationCleanupCommand

public DataGravitationCleanupCommand buildDataGravitationCleanupCommand(Fqn primaryFqn,
                                                                        Fqn backupFqn)

buildGravitateDataCommand

public GravitateDataCommand buildGravitateDataCommand(Fqn fqn,
                                                      Boolean searchSubtrees)

buildRemoveNodeCommand

public RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx,
                                                Fqn fqn)

buildClearDataCommand

public ClearDataCommand buildClearDataCommand(GlobalTransaction gtx,
                                              Fqn fqn)

buildEvictFqnCommand

public EvictCommand buildEvictFqnCommand(Fqn fqn)

buildInvalidateCommand

public InvalidateCommand buildInvalidateCommand(Fqn fqn)

buildRemoveKeyCommand

public RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx,
                                              Fqn<?> fqn,
                                              Object key)

buildGetDataMapCommand

public GetDataMapCommand buildGetDataMapCommand(Fqn fqn)

buildExistsNodeCommand

public ExistsCommand buildExistsNodeCommand(Fqn fqn)

buildGetKeyValueCommand

public GetKeyValueCommand buildGetKeyValueCommand(Fqn<?> fqn,
                                                  Object key,
                                                  boolean sendNodeEvent)

buildGetNodeCommand

public GetNodeCommand buildGetNodeCommand(Fqn fqn)

buildGetKeysCommand

public GetKeysCommand buildGetKeysCommand(Fqn fqn)

buildGetChildrenNamesCommand

public GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn)

buildMoveCommand

public MoveCommand buildMoveCommand(Fqn from,
                                    Fqn to)

buildRollbackCommand

public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)

buildOptimisticPrepareCommand

public OptimisticPrepareCommand buildOptimisticPrepareCommand(GlobalTransaction gtx,
                                                              List<ReversibleCommand> modifications,
                                                              Map data,
                                                              org.jgroups.Address address,
                                                              boolean onePhaseCommit)

buildAnnounceBuddyPoolNameCommand

public AnnounceBuddyPoolNameCommand buildAnnounceBuddyPoolNameCommand(org.jgroups.Address address,
                                                                      String buddyPoolName)

buildRemoveFromBuddyGroupCommand

public RemoveFromBuddyGroupCommand buildRemoveFromBuddyGroupCommand(String groupName)

buildAssignToBuddyGroupCommand

public AssignToBuddyGroupCommand buildAssignToBuddyGroupCommand(BuddyGroup group,
                                                                Map<Fqn,byte[]> state)

buildClusteredGetCommand

public ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees,
                                                    DataCommand dataCommand)

buildCreateNodeCommand

public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)

fromStream

public ReplicableCommand fromStream(int id,
                                    Object[] parameters)
Builds a cache command based on the ID passed in and an object array of parameters

Parameters:
id - id of the command to build
parameters - parameters attached to the command
Returns:
a newly constructed cache command


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