Package org.openspaces.remoting
Class MethodParamRemoteRoutingHandler
java.lang.Object
org.openspaces.remoting.MethodParamRemoteRoutingHandler
- All Implemented Interfaces:
RemoteRoutingHandler
A default implementation of routing handler allowing to control the routing index of the remote
invocation based on the remote method parameters.
Uses the setDefaultParamIndex(int) as the default parameter index (starting from 0)
that will be used as the hash code. Also allows to configure per method param index by setting
setMethodParamIndex(java.util.Map) (which has a method name as the key and the param
index as the value).
- Author:
- kimchy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeRouting(SpaceRemotingInvocation remotingEntry) Returns the routing field value based on the remoting invocation.voidsetDefaultParamIndex(int defaultParamIndex) The default paramter index (starting from 0) that will be used as the hash code to compute the remote routing index.voidsetMethodParamIndex(Map<String, Integer> methodParamIndex) Configures per method parameter index (starting from 0) that wil be used as the hash code to compute the routing index.
-
Constructor Details
-
MethodParamRemoteRoutingHandler
public MethodParamRemoteRoutingHandler()
-
-
Method Details
-
setDefaultParamIndex
public void setDefaultParamIndex(int defaultParamIndex) The default paramter index (starting from 0) that will be used as the hash code to compute the remote routing index. -
setMethodParamIndex
Configures per method parameter index (starting from 0) that wil be used as the hash code to compute the routing index. The map key is the method name and its value is the param index. -
computeRouting
Description copied from interface:RemoteRoutingHandlerReturns the routing field value based on the remoting invocation. Ifnullis returned, will use internal calcualtion of the routing index.- Specified by:
computeRoutingin interfaceRemoteRoutingHandler
-