org.infinispan.interceptors
Class CacheStoreInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.base.JmxStatsCommandInterceptor
org.infinispan.interceptors.CacheStoreInterceptor
- All Implemented Interfaces:
- Visitor, JmxStatisticsExposer
- Direct Known Subclasses:
- DistCacheStoreInterceptor
public class CacheStoreInterceptor
- extends JmxStatsCommandInterceptor
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.
Only used for LOCAL and INVALIDATION caches.
- Since:
- 4.0
- Author:
- Bela Ban, Dan Berindei
Field Summary |
protected boolean |
enabled
|
Method Summary |
protected void |
clearCacheStore()
|
protected void |
commitCommand(TxInvocationContext ctx)
|
void |
disableInterceptor()
|
long |
getCacheLoaderStores()
|
protected Log |
getLog()
|
Map<GlobalTransaction,Set<Object>> |
getPreparingTxs()
|
Map<GlobalTransaction,Integer> |
getTxStores()
|
protected void |
init(CacheLoaderManager loaderManager,
InternalEntryFactory entryFactory,
TransactionManager transactionManager)
|
protected boolean |
isProperWriter(InvocationContext ctx,
FlagAffectedCommand command,
Object key)
|
protected boolean |
isProperWriterForClear(InvocationContext ctx)
|
protected boolean |
isStoreEnabled()
|
protected boolean |
isStoreEnabled(FlagAffectedCommand command)
|
protected void |
prepareCacheLoader(TxInvocationContext ctx,
GlobalTransaction gtx,
TxInvocationContext transactionContext,
boolean onePhase)
|
void |
resetStatistics()
Resets statistics gathered. |
protected void |
start()
|
Object |
visitClearCommand(InvocationContext ctx,
ClearCommand command)
|
Object |
visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
|
Object |
visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
|
Object |
visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
|
Object |
visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
|
Object |
visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
|
Object |
visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
|
Object |
visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
|
Methods inherited from class org.infinispan.commands.AbstractVisitor |
visitApplyDeltaCommand, visitCollection, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
enabled
protected volatile boolean enabled
CacheStoreInterceptor
public CacheStoreInterceptor()
getLog
protected Log getLog()
- Overrides:
getLog
in class CommandInterceptor
init
protected void init(CacheLoaderManager loaderManager,
InternalEntryFactory entryFactory,
TransactionManager transactionManager)
start
protected void start()
visitCommitCommand
public Object visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
throws Throwable
- Specified by:
visitCommitCommand
in interface Visitor
- Overrides:
visitCommitCommand
in class AbstractVisitor
- Throws:
Throwable
commitCommand
protected void commitCommand(TxInvocationContext ctx)
throws Throwable
- Throws:
Throwable
visitRollbackCommand
public Object visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
throws Throwable
- Specified by:
visitRollbackCommand
in interface Visitor
- Overrides:
visitRollbackCommand
in class AbstractVisitor
- Throws:
Throwable
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
throws Throwable
- Specified by:
visitPrepareCommand
in interface Visitor
- Overrides:
visitPrepareCommand
in class AbstractVisitor
- Throws:
Throwable
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
throws Throwable
- Specified by:
visitRemoveCommand
in interface Visitor
- Overrides:
visitRemoveCommand
in class AbstractVisitor
- Throws:
Throwable
visitClearCommand
public Object visitClearCommand(InvocationContext ctx,
ClearCommand command)
throws Throwable
- Specified by:
visitClearCommand
in interface Visitor
- Overrides:
visitClearCommand
in class AbstractVisitor
- Throws:
Throwable
clearCacheStore
protected void clearCacheStore()
throws CacheLoaderException
- Throws:
CacheLoaderException
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws Throwable
- Specified by:
visitPutKeyValueCommand
in interface Visitor
- Overrides:
visitPutKeyValueCommand
in class AbstractVisitor
- Throws:
Throwable
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
throws Throwable
- Specified by:
visitReplaceCommand
in interface Visitor
- Overrides:
visitReplaceCommand
in class AbstractVisitor
- Throws:
Throwable
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
throws Throwable
- Specified by:
visitPutMapCommand
in interface Visitor
- Overrides:
visitPutMapCommand
in class AbstractVisitor
- Throws:
Throwable
prepareCacheLoader
protected final void prepareCacheLoader(TxInvocationContext ctx,
GlobalTransaction gtx,
TxInvocationContext transactionContext,
boolean onePhase)
throws Throwable
- Throws:
Throwable
isStoreEnabled
protected boolean isStoreEnabled()
isStoreEnabled
protected boolean isStoreEnabled(FlagAffectedCommand command)
isProperWriter
protected boolean isProperWriter(InvocationContext ctx,
FlagAffectedCommand command,
Object key)
isProperWriterForClear
protected boolean isProperWriterForClear(InvocationContext ctx)
resetStatistics
public void resetStatistics()
- Description copied from class:
JmxStatsCommandInterceptor
- Resets statistics gathered. Is a no-op, and should be overridden if it is to be meaningful.
- Specified by:
resetStatistics
in interface JmxStatisticsExposer
- Overrides:
resetStatistics
in class JmxStatsCommandInterceptor
getCacheLoaderStores
public long getCacheLoaderStores()
disableInterceptor
public void disableInterceptor()
getPreparingTxs
public Map<GlobalTransaction,Set<Object>> getPreparingTxs()
getTxStores
public Map<GlobalTransaction,Integer> getTxStores()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.