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 thePerCacheInboundInvocationHandler
in tests.- Since:
- 7.1
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description protected PerCacheInboundInvocationHandler
delegate
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDelegatingHandler(PerCacheInboundInvocationHandler delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterHandle(org.infinispan.commands.remote.CacheRpcCommand command, DeliverOrder order, boolean delegated)
Invoked after the command is handled.protected boolean
beforeHandle(org.infinispan.commands.remote.CacheRpcCommand command, Reply reply, DeliverOrder order)
Invoked before the command is handled by the realPerCacheInboundInvocationHandler
.int
getFirstTopologyAsMember()
boolean
getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured.void
handle(org.infinispan.commands.remote.CacheRpcCommand command, Reply reply, DeliverOrder order)
Handles theCacheRpcCommand
from other node.void
registerXSiteCommandReceiver(boolean sync)
void
resetStatistics()
Resets an interceptor's cache statisticsvoid
setFirstTopologyAsMember(int firstTopologyAsMember)
void
setStatisticsEnabled(boolean enabled)
Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.remoting.inboundhandler.PerCacheInboundInvocationHandler
registerXSiteActionSequencer
-
-
-
-
Field Detail
-
delegate
protected final PerCacheInboundInvocationHandler delegate
-
-
Constructor Detail
-
AbstractDelegatingHandler
protected AbstractDelegatingHandler(PerCacheInboundInvocationHandler delegate)
-
-
Method Detail
-
handle
public void handle(org.infinispan.commands.remote.CacheRpcCommand command, Reply reply, DeliverOrder order)
Description copied from interface:PerCacheInboundInvocationHandler
Handles theCacheRpcCommand
from other node.- Specified by:
handle
in interfacePerCacheInboundInvocationHandler
- Parameters:
command
- theCacheRpcCommand
to handle-reply
- the return value is passed to this object in order to be sent back to the senderorder
- theDeliverOrder
in which the command was sent
-
setFirstTopologyAsMember
public void setFirstTopologyAsMember(int firstTopologyAsMember)
- Specified by:
setFirstTopologyAsMember
in 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:
getFirstTopologyAsMember
in 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(org.infinispan.commands.remote.CacheRpcCommand command, Reply reply, DeliverOrder order)
Invoked before the command is handled by the realPerCacheInboundInvocationHandler
.- Returns:
true
if the command should be handled by the readPerCacheInboundInvocationHandler
,false
otherwise.
-
afterHandle
protected void afterHandle(org.infinispan.commands.remote.CacheRpcCommand command, DeliverOrder order, boolean delegated)
Invoked after the command is handled.- Parameters:
delegated
-true
if the command was handled by the realPerCacheInboundInvocationHandler
,false
otherwise.
-
registerXSiteCommandReceiver
public void registerXSiteCommandReceiver(boolean sync)
- Specified by:
registerXSiteCommandReceiver
in interfacePerCacheInboundInvocationHandler
-
getStatisticsEnabled
public boolean getStatisticsEnabled()
Description copied from interface:JmxStatisticsExposer
Returns whether an interceptor's statistics are being captured.- Specified by:
getStatisticsEnabled
in interfaceJmxStatisticsExposer
- Returns:
- true if statistics are captured
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
Description copied from interface:JmxStatisticsExposer
Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.- Specified by:
setStatisticsEnabled
in interfaceJmxStatisticsExposer
- Parameters:
enabled
- true if statistics should be captured
-
resetStatistics
public void resetStatistics()
Description copied from interface:JmxStatisticsExposer
Resets an interceptor's cache statistics- Specified by:
resetStatistics
in interfaceJmxStatisticsExposer
-
-