|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroups.blocks.MethodCall
A method call is the JavaGroup 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 | |
protected java.lang.Object[] |
args
|
protected java.lang.reflect.Method |
method
|
protected java.lang.String |
method_name
|
protected boolean |
useMethodObject
|
Constructor Summary | |
MethodCall()
creates an empty method call, this is always invalid, until SetName has been called |
|
MethodCall(java.lang.reflect.Method method)
|
|
MethodCall(java.lang.reflect.Method method,
java.lang.Object[] arguments)
|
|
MethodCall(java.lang.String name)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object arg1)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object[] args)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object arg1,
java.lang.Object arg2)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
|
MethodCall(java.lang.String name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
java.lang.Object arg5)
Deprecated. use the complete constructor with a java.lang.reflect.Method argument since null arguments can not be correctly handled using null arguments |
Method Summary | |
void |
addArg(boolean b)
adds a primitive boolean as an argument to the end of the argument list |
void |
addArg(byte b)
adds a primitive byte as an argument to the end of the argument list |
void |
addArg(char c)
adds a primitive char as an argument to the end of the argument list |
void |
addArg(int i)
adds a primitive int as an argument to the end of the argument list |
void |
addArg(long l)
adds a primitive long as an argument to the end of the argument list |
void |
addArg(java.lang.Object arg)
adds an argument to the end of the argument list |
java.util.Vector |
getArgs()
returns an ordered list of arguments used for the method invokation |
java.lang.reflect.Method |
getMethod()
|
java.lang.String |
getName()
returns the name of the method to be invoked using this method call object |
void |
init(java.lang.reflect.Method method)
|
java.lang.Object |
invoke(java.lang.Object target)
|
java.lang.Object |
invoke(java.lang.Object target,
MethodLookup lookup)
Deprecated. use the invoke(Object) method and the MethodCall(method) constructor |
static void |
main(java.lang.String[] args)
|
void |
readExternal(java.io.ObjectInput in)
|
void |
setName(java.lang.String n)
sets the name for this MethodCall and allowing you to reuse the same object for a different method invokation of a different method |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String method_name
protected java.lang.Object[] args
protected java.lang.reflect.Method method
protected boolean useMethodObject
Constructor Detail |
public MethodCall()
SetName
has been calledpublic MethodCall(java.lang.reflect.Method method)
public MethodCall(java.lang.reflect.Method method, java.lang.Object[] arguments)
public MethodCall(java.lang.String name)
name
- the name of the method, cannot be nullMethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object[] args)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object arg1)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
public MethodCall(java.lang.String name, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
name
- the name of the method, cannot be nullargs
- an array of the arguments, can be null (no arguments)MethodCall(java.lang.reflect.Method)
Method Detail |
public void init(java.lang.reflect.Method method)
public java.lang.String getName()
public void setName(java.lang.String n)
n
- - a case sensitive method namepublic java.util.Vector getArgs()
public java.lang.reflect.Method getMethod()
public void addArg(java.lang.Object arg)
arg
- - object argument for the method invokationpublic void addArg(byte b)
b
- - a byte argument for the method invokationpublic void addArg(char c)
c
- - a char argument for the method invokationpublic void addArg(boolean b)
b
- - a boolean argument for the method invokationpublic void addArg(int i)
i
- - an int argument for the method invokationpublic void addArg(long l)
l
- - a long argument for the method invokationpublic java.lang.Object invoke(java.lang.Object target) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
public java.lang.Object invoke(java.lang.Object target, MethodLookup lookup)
target
- - the object that you want to invoke the method onlookup
- - an object that allows you to lookup the method on a target object
if null is passed as a parameter, the internal FindMethod will be used
using core reflectioninvoke(Object)
public java.lang.String toString()
toString
in class java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
public static void main(java.lang.String[] args) throws java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |