org.jboss.cache.marshall
Class MethodCall

java.lang.Object
  extended by org.jgroups.blocks.MethodCall
      extended by org.jboss.cache.marshall.MethodCall
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class MethodCall
extends org.jgroups.blocks.MethodCall

An extension of the JGroups MethodCall class. The reason for this subclass is a minor optimisation in the way method IDs are dealt with. The JGroups class of the same name uses a short as a method id, which is more efficient as far as network streaming is concerned.

However, JBossCache uses this id for a lot of == and switch comparisons. Java, being an integer oriented virtual machine, goes through a lot of extra steps when performing such simple comparisons or arithmetic on non-integer numeric types.

See http://www.liemur.com/Articles/FineTuningJavaCode-IntOrientedMachine.html

Thanks to Elias Ross/genman for this info.

Author:
Manik Surtani (manik@jboss.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jgroups.blocks.MethodCall
args, ID, log, method, METHOD, method_id, method_name, mode, OLD, payload, signature, SIGNATURE, types, TYPES
 
Constructor Summary
  MethodCall()
           
protected MethodCall(java.lang.reflect.Method method, int methodIdInteger, java.lang.Object... arguments)
           
protected MethodCall(java.lang.reflect.Method method, java.lang.Object... arguments)
           
 
Method Summary
 short getId()
           
 int getMethodId()
           
 void setMethodId(int id)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jgroups.blocks.MethodCall
get, getArgs, getMethod, getMode, getName, invoke, invoke, put, readExternal, setArgs, setId, setMethod, setName, toStringDetails, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodCall

public MethodCall()

MethodCall

protected MethodCall(java.lang.reflect.Method method,
                     java.lang.Object... arguments)

MethodCall

protected MethodCall(java.lang.reflect.Method method,
                     int methodIdInteger,
                     java.lang.Object... arguments)
Method Detail

setMethodId

public void setMethodId(int id)

getMethodId

public int getMethodId()

getId

public short getId()
Overrides:
getId in class org.jgroups.blocks.MethodCall

toString

public java.lang.String toString()
Overrides:
toString in class org.jgroups.blocks.MethodCall