Top Fields Constructors Methods
net.sf.ehcache.transaction.xa.commands

public abstract Class AbstractStoreCommand

extends Object
implements Command
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.transaction.xa.commands.Command
Known Direct Subclasses
net.sf.ehcache.transaction.xa.commands.StorePutCommand, net.sf.ehcache.transaction.xa.commands.StoreRemoveCommand
Imports
net.sf.ehcache.Element, net.sf.ehcache.store.ElementValueComparator, .Store, net.sf.ehcache.transaction.SoftLock, .SoftLockManager, .SoftLockID, net.sf.ehcache.transaction.xa.OptimisticLockFailureException, .XidTransactionID

Author
Ludovic Orban

Field Summary

Modifier and TypeField and Description
private final Element
private final Element
private Element

Constructor Summary

AccessConstructor and Description
public
AbstractStoreCommand(final Element
the element in the underlying store at the time this command is created
oldElement
,
final Element
the new element to put in the underlying store
newElement
)

Create a Store Command

Method Summary

Modifier and TypeMethod and Description
private Element
createElement(Object key, SoftLockID softLockId, Store store, boolean wasPinned)

protected Element

Returns:

the new element to put in the underlying store
getNewElement
()

Get the new element to put in the underlying store

protected Element

Returns:

the old element
getOldElement
()

Get the element in the underlying store at the time this command is created

public boolean
prepare(Store
the underdyling store
store
,
SoftLockManager
the soft lock manager
softLockManager
,
XidTransactionID
the transaction ID
transactionId
,
ElementValueComparator
the element value comparator
comparator
)

Implements net.sf.ehcache.transaction.xa.commands.Command.prepare.

Prepare the commmand un the underlying store
public void
rollback(Store
the underlying store
store
,
SoftLockManager
the soft lock manager
softLockManager
)

Implements net.sf.ehcache.transaction.xa.commands.Command.rollback.

Rollback the prepared change
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

newElementback to summary
private final Element newElement
oldElementback to summary
private final Element oldElement
softLockedElementback to summary
private Element softLockedElement

Constructor Detail

AbstractStoreCommandback to summary
public AbstractStoreCommand(final Element oldElement, final Element newElement)

Create a Store Command

Parameters
oldElement:Element

the element in the underlying store at the time this command is created

newElement:Element

the new element to put in the underlying store

Method Detail

createElementback to summary
private Element createElement(Object key, SoftLockID softLockId, Store store, boolean wasPinned)
getNewElementback to summary
protected Element getNewElement()

Get the new element to put in the underlying store

Returns:Element

the new element to put in the underlying store

getOldElementback to summary
protected Element getOldElement()

Get the element in the underlying store at the time this command is created

Returns:Element

the old element

prepareback to summary
public boolean prepare(Store store, SoftLockManager softLockManager, XidTransactionID transactionId, ElementValueComparator comparator)

Implements net.sf.ehcache.transaction.xa.commands.Command.prepare.

Doc from net.sf.ehcache.transaction.xa.commands.Command.prepare.

Prepare the commmand un the underlying store

Parameters
store:Store

the underdyling store

softLockManager:SoftLockManager

the soft lock manager

transactionId:XidTransactionID

the transaction ID

comparator:ElementValueComparator

the element value comparator

Returns:boolean

true if prepare updated the store, false otherwise

rollbackback to summary
public void rollback(Store store, SoftLockManager softLockManager)

Implements net.sf.ehcache.transaction.xa.commands.Command.rollback.

Doc from net.sf.ehcache.transaction.xa.commands.Command.rollback.

Rollback the prepared change

Parameters
store:Store

the underlying store

softLockManager:SoftLockManager

the soft lock manager