ehcache

net.sf.ehcache.transaction
Interface Command

All Known Subinterfaces:
StoreWriteCommand, VersionAwareCommand
All Known Implementing Classes:
StoreExpireAllElementsCommand, StorePutCommand, StorePutIfAbsentCommand, StorePutWithWriterCommandImpl, StoreRemoveAllCommand, StoreRemoveCommand, StoreRemoveElementCommand, StoreRemoveWithWriterCommand, StoreReplaceCommand, StoreReplaceElementCommand, VersionAwareWrapper

public interface Command

A Command represents an operation to be executed on a Store.

Author:
Nabib El-Rahman, Alex Snaps
 

Field Summary
static String EXPIRE_ALL_ELEMENTS
          Store.expireElements() command
static String NULL
          No op command
static String PUT
          Store.putWithWriter(net.sf.ehcache.Element, net.sf.ehcache.writer.CacheWriterManager) command
static String PUT_IF_ABSENT
          Store.putIfAbsent(net.sf.ehcache.Element)
static String PUT_WITH_WRITER
          Store.put(net.sf.ehcache.Element) command
static String REMOVE
          Store.remove(Object) command
static String REMOVE_ALL
          Store.removeAll()
static String REMOVE_ELEMENT
          Store.removeElement(net.sf.ehcache.Element, net.sf.ehcache.store.ElementValueComparator)
static String REMOVE_WITH_WRITER
          Store.removeWithWriter(Object, net.sf.ehcache.writer.CacheWriterManager) command
static String REPLACE
          Store.replace(net.sf.ehcache.Element)
static String REPLACE_ELEMENT
          Store.replace(net.sf.ehcache.Element, net.sf.ehcache.Element, net.sf.ehcache.store.ElementValueComparator)
 
Method Summary
 boolean execute(CacheWriterManager cacheWriterManager)
          Executes the command on some cacheWriterManager
 boolean execute(Store store)
          Executes the command on some store
 String getCommandName()
           
 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
 

Field Detail

NULL

static final String NULL
No op command

See Also:
Constant Field Values

PUT_WITH_WRITER

static final String PUT_WITH_WRITER
Store.put(net.sf.ehcache.Element) command

See Also:
Constant Field Values

PUT

static final String PUT
Store.putWithWriter(net.sf.ehcache.Element, net.sf.ehcache.writer.CacheWriterManager) command

See Also:
Constant Field Values

REMOVE

static final String REMOVE
Store.remove(Object) command

See Also:
Constant Field Values

REMOVE_WITH_WRITER

static final String REMOVE_WITH_WRITER
Store.removeWithWriter(Object, net.sf.ehcache.writer.CacheWriterManager) command

See Also:
Constant Field Values

EXPIRE_ALL_ELEMENTS

static final String EXPIRE_ALL_ELEMENTS
Store.expireElements() command

See Also:
Constant Field Values

REMOVE_ALL

static final String REMOVE_ALL
Store.removeAll()

See Also:
Constant Field Values

PUT_IF_ABSENT

static final String PUT_IF_ABSENT
Store.putIfAbsent(net.sf.ehcache.Element)

See Also:
Constant Field Values

REMOVE_ELEMENT

static final String REMOVE_ELEMENT
Store.removeElement(net.sf.ehcache.Element, net.sf.ehcache.store.ElementValueComparator)

See Also:
Constant Field Values

REPLACE_ELEMENT

static final String REPLACE_ELEMENT
Store.replace(net.sf.ehcache.Element, net.sf.ehcache.Element, net.sf.ehcache.store.ElementValueComparator)

See Also:
Constant Field Values

REPLACE

static final String REPLACE
Store.replace(net.sf.ehcache.Element)

See Also:
Constant Field Values
Method Detail

getCommandName

String getCommandName()
Returns:
the command name

execute

boolean execute(Store store)
Executes the command on some store

Parameters:
store - the Store on which to execute the command
Returns:
true if the store was mutated, false otherwise

execute

boolean execute(CacheWriterManager cacheWriterManager)
Executes the command on some cacheWriterManager

Parameters:
cacheWriterManager - the CacheWriterManager on which to execute the command
Returns:
true if the CacheWriterManager was called

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

ehcache

true