org.jboss.cache.interceptors
Class CacheStoreInterceptor
java.lang.Object
org.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.base.SkipCheckChainedInterceptor
org.jboss.cache.interceptors.CacheStoreInterceptor
- All Implemented Interfaces:
- Visitor
- Direct Known Subclasses:
- LegacyCacheStoreInterceptor
public class CacheStoreInterceptor
- extends SkipCheckChainedInterceptor
Writes modifications back to the store on the way out: stores modifications back
through the CacheLoader, either after each method call (no TXs), or at TX commit.
- Version:
- $Id: CacheStoreInterceptor.java 8120 2009-06-23 08:42:25Z tkimura@redhat.com $
- Author:
- Bela Ban
Field Summary |
protected javax.transaction.TransactionManager |
txMgr
|
Method Summary |
java.util.Map<java.lang.String,java.lang.Object> |
dumpStatistics()
|
long |
getCacheLoaderStores()
|
boolean |
getStatisticsEnabled()
|
protected java.lang.Object |
handleCommitCommand(InvocationContext ctx,
CommitCommand command)
|
protected java.lang.Object |
handleMoveCommand(InvocationContext ctx,
MoveCommand command)
|
protected java.lang.Object |
handleOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand command)
|
protected java.lang.Object |
handlePrepareCommand(InvocationContext ctx,
PrepareCommand command)
|
protected java.lang.Object |
handlePutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
|
protected java.lang.Object |
handlePutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
|
protected java.lang.Object |
handlePutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
|
protected java.lang.Object |
handleRemoveDataCommand(InvocationContext ctx,
ClearDataCommand command)
|
protected java.lang.Object |
handleRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
|
protected java.lang.Object |
handleRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
remove() methods need to be applied to the CacheLoader before passing up the call: a listener might
access an element just removed, causing the CacheLoader to *load* the element before *removing* it. |
protected java.lang.Object |
handleRollbackCommand(InvocationContext ctx,
RollbackCommand command)
|
protected void |
init(CacheLoaderManager loaderManager,
javax.transaction.TransactionManager txManager,
CacheLoaderConfig clConfig)
|
protected boolean |
inTransaction()
|
protected CacheStoreInterceptor.StoreModificationsBuilder |
prepareCacheLoader(GlobalTransaction gtx,
TransactionContext transactionContext,
boolean onePhase)
|
void |
resetStatistics()
|
void |
setStatisticsEnabled(boolean enabled)
|
boolean |
skipInterception(InvocationContext ctx,
VisitableCommand command)
if this is a shared cache loader and the call is of remote origin, pass up the chain |
protected void |
start()
|
protected void |
storeStateForPutDataMap(Fqn f,
InvocationContext ctx)
|
Methods inherited from class org.jboss.cache.interceptors.base.SkipCheckChainedInterceptor |
handleAll, handleDefault, handleEvictFqnCommand, handleExistsNodeCommand, handleGetDataMapCommand, handleGetChildrenNamesCommand, handleGetKeysCommand, handleGetKeyValueCommand, handleGetNodeCommand, handleGravitateDataCommand, handleInvalidateCommand, visitClearDataCommand, visitCommitCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetDataMapCommand, visitGetChildrenNamesCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutForExternalReadCommand, visitPutKeyValueCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
txMgr
protected javax.transaction.TransactionManager txMgr
CacheStoreInterceptor
public CacheStoreInterceptor()
init
protected void init(CacheLoaderManager loaderManager,
javax.transaction.TransactionManager txManager,
CacheLoaderConfig clConfig)
start
protected void start()
skipInterception
public boolean skipInterception(InvocationContext ctx,
VisitableCommand command)
- if this is a shared cache loader and the call is of remote origin, pass up the chain
- Specified by:
skipInterception
in class SkipCheckChainedInterceptor
- Parameters:
ctx
- invocation contextcommand
- command
- Returns:
- true if the invocation should skip the current interceptor and move on to the next in the chain, false otherwise.
handleCommitCommand
protected java.lang.Object handleCommitCommand(InvocationContext ctx,
CommitCommand command)
throws java.lang.Throwable
- Overrides:
handleCommitCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleRollbackCommand
protected java.lang.Object handleRollbackCommand(InvocationContext ctx,
RollbackCommand command)
throws java.lang.Throwable
- Overrides:
handleRollbackCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleOptimisticPrepareCommand
protected java.lang.Object handleOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand command)
throws java.lang.Throwable
- Overrides:
handleOptimisticPrepareCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handlePrepareCommand
protected java.lang.Object handlePrepareCommand(InvocationContext ctx,
PrepareCommand command)
throws java.lang.Throwable
- Overrides:
handlePrepareCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleRemoveNodeCommand
protected java.lang.Object handleRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
throws java.lang.Throwable
- remove() methods need to be applied to the CacheLoader before passing up the call: a listener might
access an element just removed, causing the CacheLoader to *load* the element before *removing* it.
- Overrides:
handleRemoveNodeCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleRemoveKeyCommand
protected java.lang.Object handleRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
throws java.lang.Throwable
- Overrides:
handleRemoveKeyCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleRemoveDataCommand
protected java.lang.Object handleRemoveDataCommand(InvocationContext ctx,
ClearDataCommand command)
throws java.lang.Throwable
- Overrides:
handleRemoveDataCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handleMoveCommand
protected java.lang.Object handleMoveCommand(InvocationContext ctx,
MoveCommand command)
throws java.lang.Throwable
- Overrides:
handleMoveCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handlePutDataMapCommand
protected java.lang.Object handlePutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
throws java.lang.Throwable
- Overrides:
handlePutDataMapCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
storeStateForPutDataMap
protected void storeStateForPutDataMap(Fqn f,
InvocationContext ctx)
throws java.lang.Exception
- Throws:
java.lang.Exception
handlePutKeyValueCommand
protected java.lang.Object handlePutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws java.lang.Throwable
- Overrides:
handlePutKeyValueCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
handlePutForExternalReadCommand
protected java.lang.Object handlePutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
throws java.lang.Throwable
- Overrides:
handlePutForExternalReadCommand
in class SkipCheckChainedInterceptor
- Throws:
java.lang.Throwable
inTransaction
protected boolean inTransaction()
throws javax.transaction.SystemException
- Throws:
javax.transaction.SystemException
prepareCacheLoader
protected CacheStoreInterceptor.StoreModificationsBuilder prepareCacheLoader(GlobalTransaction gtx,
TransactionContext transactionContext,
boolean onePhase)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
resetStatistics
public void resetStatistics()
dumpStatistics
public java.util.Map<java.lang.String,java.lang.Object> dumpStatistics()
getStatisticsEnabled
public boolean getStatisticsEnabled()
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
getCacheLoaderStores
public long getCacheLoaderStores()
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.