Package org.infinispan.interceptors.impl
Class TxInterceptor
java.lang.Object
org.infinispan.interceptors.BaseAsyncInterceptor
org.infinispan.interceptors.DDAsyncInterceptor
org.infinispan.interceptors.impl.TxInterceptor
- All Implemented Interfaces:
Visitor,AsyncInterceptor,JmxStatisticsExposer,CustomMetricsSupplier
@MBean(objectName="Transactions",
description="Component that manages the cache\'s participation in JTA transactions.")
public class TxInterceptor
extends DDAsyncInterceptor
implements JmxStatisticsExposer, CustomMetricsSupplier
Interceptor in charge with handling transaction related operations, e.g enlisting cache as an transaction
participant, propagating remotely initiated changes.
- Since:
- 9.0
- Author:
- Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com
- See Also:
-
Field Summary
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongCollection<org.infinispan.commons.stat.MetricInfo> getCustomMetrics(GlobalMetricsConfiguration configuration) Extra metrics to be registered.longlongbooleanReturns whether an interceptor's statistics are being captured.booleanvoidResets an interceptor's cache statisticsvoidsetStatisticsEnabled(boolean enabled) Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.voidstart()visitClearCommand(InvocationContext ctx, ClearCommand command) visitCommitCommand(TxInvocationContext ctx, CommitCommand command) visitComputeCommand(InvocationContext ctx, ComputeCommand command) visitEntrySetCommand(InvocationContext ctx, EntrySetCommand command) visitGetAllCommand(InvocationContext ctx, GetAllCommand command) final ObjectvisitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) visitInvalidateCommand(InvocationContext ctx, InvalidateCommand invalidateCommand) visitKeySetCommand(InvocationContext ctx, KeySetCommand command) visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) visitPutMapCommand(InvocationContext ctx, PutMapCommand command) visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) visitRemoveCommand(InvocationContext ctx, RemoveCommand command) visitRemoveExpiredCommand(InvocationContext ctx, RemoveExpiredCommand command) visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) visitRollbackCommand(TxInvocationContext ctx, RollbackCommand command) visitSizeCommand(InvocationContext ctx, SizeCommand command) visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitEvictCommand, visitInvalidateL1Command, visitIracPutKeyValueCommand, visitTouchCommand, visitUnknownCommandMethods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
Constructor Details
-
TxInterceptor
public TxInterceptor()
-
-
Method Details
-
start
public void start() -
visitPrepareCommand
- Specified by:
visitPrepareCommandin interfaceVisitor- Overrides:
visitPrepareCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitCommitCommand
- Specified by:
visitCommitCommandin interfaceVisitor- Overrides:
visitCommitCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitRollbackCommand
public Object visitRollbackCommand(TxInvocationContext ctx, RollbackCommand command) throws Throwable - Specified by:
visitRollbackCommandin interfaceVisitor- Overrides:
visitRollbackCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitLockControlCommand
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable - Specified by:
visitLockControlCommandin interfaceVisitor- Overrides:
visitLockControlCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable - Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitRemoveCommand
- Specified by:
visitRemoveCommandin interfaceVisitor- Overrides:
visitRemoveCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitRemoveExpiredCommand
- Specified by:
visitRemoveExpiredCommandin interfaceVisitor
-
visitReplaceCommand
- Specified by:
visitReplaceCommandin interfaceVisitor- Overrides:
visitReplaceCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeCommand
- Specified by:
visitComputeCommandin interfaceVisitor- Overrides:
visitComputeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command) throws Throwable - Specified by:
visitComputeIfAbsentCommandin interfaceVisitor- Overrides:
visitComputeIfAbsentCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitClearCommand
- Specified by:
visitClearCommandin interfaceVisitor- Overrides:
visitClearCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutMapCommand
- Specified by:
visitPutMapCommandin interfaceVisitor- Overrides:
visitPutMapCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitSizeCommand
- Specified by:
visitSizeCommandin interfaceVisitor- Overrides:
visitSizeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitKeySetCommand
- Specified by:
visitKeySetCommandin interfaceVisitor- Overrides:
visitKeySetCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitEntrySetCommand
- Specified by:
visitEntrySetCommandin interfaceVisitor- Overrides:
visitEntrySetCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitInvalidateCommand
public Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand invalidateCommand) throws Throwable - Specified by:
visitInvalidateCommandin interfaceVisitor- Overrides:
visitInvalidateCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable - Specified by:
visitGetKeyValueCommandin interfaceVisitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetCacheEntryCommand
public final Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) throws Throwable - Specified by:
visitGetCacheEntryCommandin interfaceVisitor- Overrides:
visitGetCacheEntryCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetAllCommand
- Specified by:
visitGetAllCommandin interfaceVisitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable - Specified by:
visitReadOnlyKeyCommandin interfaceVisitor- Overrides:
visitReadOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable - Specified by:
visitReadOnlyManyCommandin interfaceVisitor- Overrides:
visitReadOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) throws Throwable - Specified by:
visitWriteOnlyKeyCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command) throws Throwable - Specified by:
visitReadWriteKeyValueCommandin interfaceVisitor- Overrides:
visitReadWriteKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable - Specified by:
visitReadWriteKeyCommandin interfaceVisitor- Overrides:
visitReadWriteKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, WriteOnlyManyEntriesCommand command) throws Throwable - Specified by:
visitWriteOnlyManyEntriesCommandin interfaceVisitor- Overrides:
visitWriteOnlyManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, WriteOnlyKeyValueCommand command) throws Throwable - Specified by:
visitWriteOnlyKeyValueCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) throws Throwable - Specified by:
visitWriteOnlyManyCommandin interfaceVisitor- Overrides:
visitWriteOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) throws Throwable - Specified by:
visitReadWriteManyCommandin interfaceVisitor- Overrides:
visitReadWriteManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable - Specified by:
visitReadWriteManyEntriesCommandin interfaceVisitor- Overrides:
visitReadWriteManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
getStatisticsEnabled
public boolean getStatisticsEnabled()Description copied from interface:JmxStatisticsExposerReturns whether an interceptor's statistics are being captured.- Specified by:
getStatisticsEnabledin interfaceJmxStatisticsExposer- Returns:
- true if statistics are captured
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled) Description copied from interface:JmxStatisticsExposerEnables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.- Specified by:
setStatisticsEnabledin interfaceJmxStatisticsExposer- Parameters:
enabled- true if statistics should be captured
-
resetStatistics
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset Statistics") public void resetStatistics()Description copied from interface:JmxStatisticsExposerResets an interceptor's cache statistics- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer
-
isStatisticsEnabled
@ManagedAttribute(displayName="Statistics enabled", dataType=TRAIT, writable=true) public boolean isStatisticsEnabled() -
getPrepares
@ManagedAttribute(description="Number of transaction prepares performed since last reset", displayName="Prepares", measurementType=TRENDSUP) public long getPrepares() -
getCommits
@ManagedAttribute(description="Number of transaction commits performed since last reset", displayName="Commits", measurementType=TRENDSUP) public long getCommits() -
getRollbacks
@ManagedAttribute(description="Number of transaction rollbacks performed since last reset", displayName="Rollbacks", measurementType=TRENDSUP) public long getRollbacks() -
getCustomMetrics
public Collection<org.infinispan.commons.stat.MetricInfo> getCustomMetrics(GlobalMetricsConfiguration configuration) Description copied from interface:CustomMetricsSupplierExtra metrics to be registered.These can be dynamic metrics that cannot use
ManagedAttributeannotation. Extra tags can be set inMBeanMetadata.AttributeMetadata.- Specified by:
getCustomMetricsin interfaceCustomMetricsSupplier- Parameters:
configuration- TheGlobalMetricsConfiguration. Implementation can make decision based onGlobalMetricsConfiguration.namesAsTags()orGlobalMetricsConfiguration.histograms().- Returns:
- A list of
MBeanMetadata.AttributeMetadatato be registered.
-