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, SoftLockFactory softLockFactory, XidTransactionID transactionId, ElementValueComparator comparator)
          Prepare the commmand un the underlying store
 void rollback(Store store)
          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,
                SoftLockFactory softLockFactory,
                XidTransactionID transactionId,
                ElementValueComparator comparator)
Prepare the commmand un the underlying store

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

rollback

void rollback(Store store)
Rollback the prepared change

Parameters:
store - the underlying store

getObjectKey

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

Returns:
the element's key

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.