Package org.jgroups.blocks
Class MethodCall
java.lang.Object
org.jgroups.blocks.MethodCall
- All Implemented Interfaces:
Constructable<MethodCall>,Streamable
- Direct Known Subclasses:
PerfUtil.CustomCall,PerfUtil.GetCall,PerfUtil.PutCall
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNeeded for deserializationMethodCall(short method_id, Object... args) MethodCall(Method m, Object... arguments) MethodCall(String method_name, Object[] args, Class<?>[] types) -
Method Summary
Modifier and TypeMethodDescriptionprotected static shortassertNotNegative(short num) Supplier<? extends MethodCall> create()Creates an instance of the class implementing this interfaceObject[]getArgs()shortInvokes the method with the supplied arguments against the target object.protected Objectprotected voidvoidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedprotected voidsetMethodId(short id) toString()booleanuseIds()protected voidwriteArg(DataOutput out, Object obj) protected voidwriteArgs(DataOutput out) protected voidwriteMethod(DataOutput out) voidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.protected voidwriteTypes(DataOutput out)
-
Field Details
-
method_name
-
method_id
protected short method_id -
args
-
types
-
method
-
-
Constructor Details
-
MethodCall
public MethodCall()Needed for deserialization -
MethodCall
-
MethodCall
-
MethodCall
-
-
Method Details
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<MethodCall>
-
useIds
public boolean useIds() -
getMethodName
-
getMethodId
public short getMethodId() -
setMethodId
-
getArgs
-
setArgs
-
getMethod
-
setMethod
-
invoke
Invokes the method with the supplied arguments against the target object.- Parameters:
target- - the object that you want to invoke the method on- Returns:
- the result
- Throws:
Exception
-
invoke
- Throws:
Exception
-
toString
-
toStringDetails
-
writeTo
Description copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Throws:
IOExceptionClassNotFoundException
-
writeArgs
- Throws:
IOException
-
writeArg
- Throws:
IOException
-
readArgs
- Throws:
IOExceptionClassNotFoundException
-
readArg
- Throws:
IOExceptionClassNotFoundException
-
writeTypes
- Throws:
IOException
-
readTypes
- Throws:
IOExceptionClassNotFoundException
-
writeMethod
- Throws:
IOException
-
assertNotNegative
protected static short assertNotNegative(short num)
-