public class MethodCall extends Object implements Externalizable, Streamable
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 MethodLookup |
lookup |
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 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)
Called by the ProbeHandler impl.
|
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) |
static boolean |
isPrimitiveType(Class<?> type) |
MethodCall |
lookup(MethodLookup lookup) |
protected void |
readArgs(DataInput in) |
void |
readExternal(ObjectInput in) |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
protected void |
readMethod(DataInput in) |
protected void |
readTypes(DataInput 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() |
protected void |
writeArgs(DataOutput out) |
void |
writeExternal(ObjectOutput out) |
protected void |
writeMethod(DataOutput out) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected void |
writeTypes(DataOutput 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 MethodLookup lookup
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 MethodCall lookup(MethodLookup lookup)
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
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
Exception
protected void writeArgs(DataOutput out) throws Exception
Exception
protected void writeTypes(DataOutput out) throws Exception
Exception
protected void writeMethod(DataOutput out) throws Exception
Exception
public static boolean isPrimitiveType(Class<?> type)
Copyright © 2022 JBoss, a division of Red Hat. All rights reserved.