public class MethodCall extends Object implements Externalizable
Modifier and Type | Field and Description |
---|---|
protected Object[] |
args
The arguments of the method.
|
protected static short |
ID
Use an ID to map to a method
|
protected static Log |
log |
protected Method |
method
The Method of the call.
|
protected static short |
METHOD
Explicitly ship the method, caller has to determine method himself.
|
protected short |
method_id
The ID of a method, maps to a java.lang.reflect.Method
|
protected String |
method_name
The name of the method, case sensitive.
|
protected short |
mode
Which mode to use.
|
protected static short |
OLD
Infer the method from the arguments.
|
protected Class[] |
types
The class types, e.g., new Class[]{String.class, int.class}.
|
protected static short |
TYPES
Use class information.
|
Constructor and Description |
---|
MethodCall()
Creates an empty method call, this is always invalid, until
setName() has been called. |
MethodCall(Method method) |
MethodCall(Method method,
Object... arguments) |
MethodCall(short method_id,
Object... args) |
MethodCall(String method_name,
Object[] args,
Class[] types) |
Modifier and Type | Method and Description |
---|---|
static Object |
convert(String arg,
Class<?> type) |
static Method |
findMethod(Class target_class,
String method_name,
Object[] args) |
Object[] |
getArgs()
returns an ordered list of arguments used for the method invokation
|
short |
getId() |
Method |
getMethod() |
int |
getMode() |
String |
getName()
returns the name of the method to be invoked using this method call object
|
Object |
invoke(Object target)
Invokes the method with the supplied arguments against the target object.
|
Object |
invoke(Object target,
Object[] args) |
void |
readExternal(ObjectInput in) |
void |
setArgs(Object... args) |
void |
setId(short method_id) |
void |
setMethod(Method m) |
void |
setName(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
|
String |
toString() |
String |
toStringDetails() |
void |
writeExternal(ObjectOutput out) |
protected String method_name
protected short method_id
protected Object[] args
protected Class[] types
protected Method method
protected static final Log log
protected short mode
protected static final short OLD
protected static final short METHOD
protected static final short TYPES
protected static final short ID
public MethodCall()
setName()
has been called.public MethodCall(Method method)
public MethodCall(short method_id, Object... args)
public int getMode()
public String getName()
public void setName(String n)
n
- - a case sensitive method namepublic short getId()
public void setId(short method_id)
public Object[] getArgs()
public void setArgs(Object... args)
public Method getMethod()
public void setMethod(Method m)
public static Method findMethod(Class target_class, String method_name, Object[] args) throws Exception
Exception
public Object invoke(Object target) throws Exception
target
- - the object that you want to invoke the method onException
public String toStringDetails()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.