ehcache

net.sf.ehcache.transaction
Interface Command

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

public interface Command

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

Author:
Nabib El-Rahman, Alex Snaps

Field Summary
static java.lang.String EXPIRE_ALL_ELEMENTS
          Store.expireElements() command
static java.lang.String NULL
          No op command
static java.lang.String PUT
          Store.putWithWriter(net.sf.ehcache.Element, net.sf.ehcache.writer.CacheWriterManager) command
static java.lang.String PUT_WITH_WRITER
          Store.put(net.sf.ehcache.Element) command
static java.lang.String REMOVE
          Store.remove(Object) command
static java.lang.String REMOVE_ALL
          Store.removeAll()
static java.lang.String REMOVE_WITH_WRITER
          Store.removeWithWriter(Object, net.sf.ehcache.writer.CacheWriterManager) command
 
Method Summary
 boolean execute(CacheWriterManager cacheWriterManager)
          Executes the command on some cacheWriterManager
 boolean execute(Store store)
          Executes the command on some store
 java.lang.String getCommandName()
           
 boolean isPut(java.lang.Object key)
          Is this command represents adding a key to the store
 boolean isRemove(java.lang.Object key)
          Is this command represents removing a key to the store
 

Field Detail

NULL

static final java.lang.String NULL
No op command

See Also:
Constant Field Values

PUT_WITH_WRITER

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

See Also:
Constant Field Values

PUT

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

See Also:
Constant Field Values

REMOVE

static final java.lang.String REMOVE
Store.remove(Object) command

See Also:
Constant Field Values

REMOVE_WITH_WRITER

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

See Also:
Constant Field Values

EXPIRE_ALL_ELEMENTS

static final java.lang.String EXPIRE_ALL_ELEMENTS
Store.expireElements() command

See Also:
Constant Field Values

REMOVE_ALL

static final java.lang.String REMOVE_ALL
Store.removeAll()

See Also:
Constant Field Values
Method Detail

getCommandName

java.lang.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(java.lang.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(java.lang.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