GigaSpaces XAP 9.7.2 API

org.openspaces.remoting
Class MethodParamRemoteRoutingHandler

java.lang.Object
  extended by org.openspaces.remoting.MethodParamRemoteRoutingHandler
All Implemented Interfaces:
RemoteRoutingHandler

public class MethodParamRemoteRoutingHandler
extends Object
implements 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
MethodParamRemoteRoutingHandler()
           
 
Method Summary
 Object computeRouting(SpaceRemotingInvocation remotingEntry)
          Returns the routing field value based on the remoting invocation.
 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.
 void setMethodParamIndex(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodParamRemoteRoutingHandler

public MethodParamRemoteRoutingHandler()
Method Detail

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

public void setMethodParamIndex(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. The map key is the method name and its value is the param index.


computeRouting

public Object computeRouting(SpaceRemotingInvocation remotingEntry)
Description copied from interface: RemoteRoutingHandler
Returns the routing field value based on the remoting invocation. If null is returned, will use internal calcualtion of the routing index.

Specified by:
computeRouting in interface RemoteRoutingHandler

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.