ehcache

net.sf.ehcache.transaction
Class StorePutCommand

java.lang.Object
  extended by net.sf.ehcache.transaction.StorePutCommand
All Implemented Interfaces:
Command, StoreWriteCommand
Direct Known Subclasses:
StorePutWithWriterCommandImpl

public class StorePutCommand
extends java.lang.Object
implements StoreWriteCommand

Represents a Store.put(net.sf.ehcache.Element) put} operation to be executed on a Store.

Author:
Alex Snaps

Field Summary
 
Fields inherited from interface net.sf.ehcache.transaction.Command
EXPIRE_ALL_ELEMENTS, NULL, PUT, PUT_WITH_WRITER, REMOVE, REMOVE_ALL, REMOVE_WITH_WRITER
 
Constructor Summary
StorePutCommand(Element element)
          Constructs a put command for an Element
 
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()
          
 Element getElement()
          Getter to the Element instance to be put in the Store
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorePutCommand

public StorePutCommand(Element element)
Constructs a put command for an Element

Parameters:
element - to put in the store on execute(net.sf.ehcache.store.Store)
Method Detail

execute

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

Specified by:
execute in interface Command
Parameters:
store - the Store on which to execute the command
Returns:
true if the store was mutated, false otherwise

execute

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

Specified by:
execute in interface Command
Parameters:
cacheWriterManager - the CacheWriterManager on which to execute the command
Returns:
true if the CacheWriterManager was called

isPut

public boolean isPut(java.lang.Object key)
Is this command represents adding a key to the store

Specified by:
isPut in interface Command
Parameters:
key - the key
Returns:
true, if this command would try to add an Element for key, otherwise false

isRemove

public boolean isRemove(java.lang.Object key)
Is this command represents removing a key to the store

Specified by:
isRemove in interface Command
Parameters:
key - the key
Returns:
true, if this command would try to remove an Element for key, otherwise false

getElement

public Element getElement()
Getter to the Element instance to be put in the Store

Returns:
the element instance

getCommandName

public java.lang.String getCommandName()

Specified by:
getCommandName in interface Command
Returns:
the command name

ehcache

true