ehcache

net.sf.ehcache.transaction.xa.commands
Interface Command

All Known Implementing Classes:
AbstractStoreCommand, StorePutCommand, StoreRemoveCommand

public interface Command

Author:
Ludovic Orban

Method Summary
 Object getObjectKey()
          Get the key of the element this command is working on
 boolean isPut(Object key)
          Is this command represents adding a key to the store
 boolean isRemove(Object key)
          Is this command represents removing a key to the store
 boolean prepare(Store store, SoftLockManager softLockManager, XidTransactionID transactionId, ElementValueComparator comparator)
          Prepare the commmand un the underlying store
 void rollback(Store store, SoftLockManager softLockManager)
          Rollback the prepared change
 

Method Detail

isPut

boolean isPut(Object key)
Is this command represents adding a key to the store

Parameters:
key - the key
Returns:
true, if this command would try to add an Element for key, otherwise false

isRemove

boolean isRemove(Object key)
Is this command represents removing a key to the store

Parameters:
key - the key
Returns:
true, if this command would try to remove an Element for key, otherwise false

prepare

boolean prepare(Store store,
                SoftLockManager softLockManager,
                XidTransactionID transactionId,
                ElementValueComparator comparator)
Prepare the commmand un the underlying store

Parameters:
store - the underdyling store
softLockManager - the soft lock manager
transactionId - the transaction ID
comparator - the element value comparator
Returns:
true if prepare updated the store, false otherwise

rollback

void rollback(Store store,
              SoftLockManager softLockManager)
Rollback the prepared change

Parameters:
store - the underlying store
softLockManager - the soft lock manager

getObjectKey

Object getObjectKey()
Get the key of the element this command is working on

Returns:
the element's key

ehcache

Copyright 2001-2017, Terracotta, Inc.