public class XATransactionContext extends Object
It will queue operations (Commands
), filter read operations on the cache (as for
returning null on a get on a "to be removed" key).
Constructor and Description |
---|
XATransactionContext(Store underlyingStore)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(Command command,
Element element)
Add a command to the current LocalTransactionContext
|
Element |
get(Object key)
Filter to get operations on underlying Store.
|
Collection |
getAddedKeys()
Queries the local tx context, whether the key is pending removal
|
List<Command> |
getCommands()
All ordered pending commands
|
Collection |
getRemovedKeys()
getter to all keys pending deletion from the store
|
int |
getSizeModifier()
The underlying store's size modifier.
|
boolean |
isRemoved(Object key)
Queries the local tx context, whether the key is pending removal
|
String |
toString() |
public XATransactionContext(Store underlyingStore)
underlyingStore
- the underlying storepublic void addCommand(Command command, Element element)
command
- Command to be deferredelement
- Element the command impacts, may be nullpublic List<Command> getCommands()
public Element get(Object key)
Should the key still be transaction local, or locally pending deletion
key
- the keypublic boolean isRemoved(Object key)
key
- the key pending removalpublic Collection getAddedKeys()
public Collection getRemovedKeys()
public int getSizeModifier()
Plus all pending put commands, and minus all pending removals (dependent on whether their in the underlying store)
Store.getSize()
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.