Package org.jgroups.blocks
Class MethodCall
java.lang.Object
org.jgroups.blocks.MethodCall
- All Implemented Interfaces:
Externalizable,Serializable
A method call is the JGroups representation of a remote method.
It includes the name of the method (case sensitive) and a list of arguments.
A method call is serializable and can be passed over the wire.
- Version:
- $Revision: 1.39 $
- Author:
- Bela Ban
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Object[]The arguments of the method.protected static final shortUse an ID to map to a methodprotected static final Logprotected MethodThe Method of the call.protected static final shortExplicitly ship the method, caller has to determine method himself.protected shortThe ID of a method, maps to a java.lang.reflect.Methodprotected StringThe name of the method, case sensitive.protected shortWhich mode to use.protected static final shortInfer the method from the arguments.protected MapDeprecated.protected String[]Deprecated.protected static final shortProvide a signature, similar to JMX.protected Class[]The class types, e.g., new Class[]{String.class, int.class}.protected static final shortUse class information. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty method call, this is always invalid, untilsetName()has been called.MethodCall(short method_id, Object... args) MethodCall(Method method) MethodCall(Method method, Object... arguments) MethodCall(String method_name, Object... args) Deprecated.MethodCall(String method_name, Object[] args, Class[] types) MethodCall(String method_name, Object[] args, String[] signature) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic MethodfindMethod(Class target_class, String method_name, Object[] args) Deprecated.Object[]getArgs()returns an ordered list of arguments used for the method invokationshortgetId()intgetMode()getName()returns the name of the method to be invoked using this method call objectInvokes the method with the supplied arguments against the target object.Deprecated.voidvoidvoidsetId(short method_id) voidvoidsets the name for this MethodCall and allowing you to reuse the same object for a different method invokation of a different methodtoString()void
-
Field Details
-
method_name
The name of the method, case sensitive. -
method_id
protected short method_idThe ID of a method, maps to a java.lang.reflect.Method -
args
The arguments of the method. -
types
The class types, e.g., new Class[]{String.class, int.class}. -
signature
Deprecated.The signature, e.g., new String[]{String.class.getName(), int.class.getName()}. -
method
The Method of the call. -
payload
Deprecated.To carry arbitrary data with a method call, data needs to be serializable if sent across the wire -
log
-
mode
protected short modeWhich mode to use. -
OLD
protected static final short OLDInfer the method from the arguments.- See Also:
-
METHOD
protected static final short METHODExplicitly ship the method, caller has to determine method himself.- See Also:
-
TYPES
protected static final short TYPESUse class information.- See Also:
-
SIGNATURE
protected static final short SIGNATUREProvide a signature, similar to JMX.- See Also:
-
ID
protected static final short IDUse an ID to map to a method- See Also:
-
-
Constructor Details
-
MethodCall
public MethodCall()Creates an empty method call, this is always invalid, untilsetName()has been called. -
MethodCall
-
MethodCall
-
MethodCall
Deprecated.- Parameters:
method_name-args-
-
MethodCall
-
MethodCall
-
MethodCall
Deprecated.
-
-
Method Details
-
getMode
public int getMode() -
getName
returns the name of the method to be invoked using this method call object- Returns:
- a case sensitive name, can be null for an invalid method call
-
setName
sets the name for this MethodCall and allowing you to reuse the same object for a different method invokation of a different method- Parameters:
n- - a case sensitive method name
-
getId
public short getId() -
setId
public void setId(short method_id) -
getArgs
returns an ordered list of arguments used for the method invokation- Returns:
- returns the list of ordered arguments
-
setArgs
-
getMethod
-
setMethod
-
put
Deprecated. -
get
Deprecated. -
findMethod
public static Method findMethod(Class target_class, String method_name, Object[] args) throws Exception - Throws:
Exception
-
invoke
Invokes the method with the supplied arguments against the target object. If a method lookup is provided, it will be used. Otherwise, the default method lookup will be used.- Parameters:
target- - the object that you want to invoke the method on- Returns:
- an object
- Throws:
Throwable
-
invoke
- Throws:
Throwable
-
toString
-
toStringDetails
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
convert
-