Class AbstractDelegatingHandler
- java.lang.Object
-
- org.infinispan.remoting.inboundhandler.AbstractDelegatingHandler
-
- All Implemented Interfaces:
JmxStatisticsExposer,PerCacheInboundInvocationHandler
public abstract class AbstractDelegatingHandler extends Object implements PerCacheInboundInvocationHandler
Class to be extended to allow some control over thePerCacheInboundInvocationHandlerin tests.- Since:
- 7.1
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description protected PerCacheInboundInvocationHandlerdelegate
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDelegatingHandler(PerCacheInboundInvocationHandler delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterHandle(CacheRpcCommand command, DeliverOrder order, boolean delegated)Invoked after the command is handled.protected booleanbeforeHandle(CacheRpcCommand command, Reply reply, DeliverOrder order)Invoked before the command is handled by the realPerCacheInboundInvocationHandler.voidcheckForReadyTasks()Checks if any pending tasks are now ready to be ran and will run in them in a separate thread.intgetFirstTopologyAsMember()booleangetStatisticsEnabled()Returns whether an interceptor's statistics are being captured.voidhandle(CacheRpcCommand command, Reply reply, DeliverOrder order)Handles theCacheRpcCommandfrom other node.voidregisterXSiteCommandReceiver()voidresetStatistics()Resets an interceptor's cache statisticsvoidsetFirstTopologyAsMember(int firstTopologyAsMember)voidsetStatisticsEnabled(boolean enabled)Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.
-
-
-
Field Detail
-
delegate
protected final PerCacheInboundInvocationHandler delegate
-
-
Constructor Detail
-
AbstractDelegatingHandler
protected AbstractDelegatingHandler(PerCacheInboundInvocationHandler delegate)
-
-
Method Detail
-
handle
public void handle(CacheRpcCommand command, Reply reply, DeliverOrder order)
Description copied from interface:PerCacheInboundInvocationHandlerHandles theCacheRpcCommandfrom other node.- Specified by:
handlein interfacePerCacheInboundInvocationHandler- Parameters:
command- theCacheRpcCommandto handle.reply- the return value is passed to this object in order to be sent back to the senderorder- theDeliverOrderin which the command was sent
-
setFirstTopologyAsMember
public void setFirstTopologyAsMember(int firstTopologyAsMember)
- Specified by:
setFirstTopologyAsMemberin interfacePerCacheInboundInvocationHandler- Parameters:
firstTopologyAsMember- The first topology in which the local node was a member. Any command with a lower topology id will be ignored.
-
getFirstTopologyAsMember
public int getFirstTopologyAsMember()
- Specified by:
getFirstTopologyAsMemberin interfacePerCacheInboundInvocationHandler- Returns:
- The first topology in which the local node was a member. Any command with a lower topology id will be ignored.
-
beforeHandle
protected boolean beforeHandle(CacheRpcCommand command, Reply reply, DeliverOrder order)
Invoked before the command is handled by the realPerCacheInboundInvocationHandler.- Returns:
trueif the command should be handled by the readPerCacheInboundInvocationHandler,falseotherwise.
-
afterHandle
protected void afterHandle(CacheRpcCommand command, DeliverOrder order, boolean delegated)
Invoked after the command is handled.- Parameters:
delegated-trueif the command was handled by the realPerCacheInboundInvocationHandler,falseotherwise.
-
registerXSiteCommandReceiver
public void registerXSiteCommandReceiver()
- Specified by:
registerXSiteCommandReceiverin interfacePerCacheInboundInvocationHandler
-
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
public void resetStatistics()
Description copied from interface:JmxStatisticsExposerResets an interceptor's cache statistics- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer
-
checkForReadyTasks
public void checkForReadyTasks()
Description copied from interface:PerCacheInboundInvocationHandlerChecks if any pending tasks are now ready to be ran and will run in them in a separate thread. This method does not block.- Specified by:
checkForReadyTasksin interfacePerCacheInboundInvocationHandler
-
-