public class MethodCall extends java.lang.Object implements java.io.Externalizable, Streamable
Modifier and Type | Field and Description |
---|---|
protected java.lang.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 java.lang.reflect.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 java.lang.String |
method_name
The name of the method, case sensitive.
|
protected short |
mode
Which mode to use.
|
protected java.lang.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(java.lang.reflect.Method method) |
MethodCall(java.lang.reflect.Method method,
java.lang.Object... arguments) |
MethodCall(short method_id,
java.lang.Object... args) |
MethodCall(java.lang.String method_name,
java.lang.Object[] args,
java.lang.Class[] types) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
convert(java.lang.String arg,
java.lang.Class<?> type) |
static java.lang.reflect.Method |
findMethod(java.lang.Class target_class,
java.lang.String method_name,
java.lang.Object[] args)
Called by the ProbeHandler impl.
|
java.lang.Object[] |
getArgs()
returns an ordered list of arguments used for the method invokation
|
short |
getId() |
java.lang.reflect.Method |
getMethod() |
int |
getMode() |
java.lang.String |
getName()
returns the name of the method to be invoked using this method call object
|
java.lang.Object |
invoke(java.lang.Object target)
Invokes the method with the supplied arguments against the target object.
|
java.lang.Object |
invoke(java.lang.Object target,
java.lang.Object[] args) |
static boolean |
isPrimitiveType(java.lang.Class<?> type) |
MethodCall |
lookup(MethodLookup lookup) |
protected void |
readArgs(java.io.DataInput in) |
void |
readExternal(java.io.ObjectInput in) |
void |
readFrom(java.io.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(java.io.DataInput in) |
protected void |
readTypes(java.io.DataInput in) |
void |
setArgs(java.lang.Object... args) |
void |
setId(short method_id) |
void |
setMethod(java.lang.reflect.Method m) |
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() |
java.lang.String |
toStringDetails() |
protected void |
writeArgs(java.io.DataOutput out) |
void |
writeExternal(java.io.ObjectOutput out) |
protected void |
writeMethod(java.io.DataOutput out) |
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected void |
writeTypes(java.io.DataOutput out) |
protected java.lang.String method_name
protected short method_id
protected java.lang.Object[] args
protected java.lang.Class[] types
protected java.lang.reflect.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(java.lang.reflect.Method method)
public MethodCall(java.lang.reflect.Method method, java.lang.Object... arguments)
public MethodCall(short method_id, java.lang.Object... args)
public MethodCall(java.lang.String method_name, java.lang.Object[] args, java.lang.Class[] types)
public MethodCall lookup(MethodLookup lookup)
public int getMode()
public java.lang.String getName()
public void setName(java.lang.String n)
n
- - a case sensitive method namepublic short getId()
public void setId(short method_id)
public java.lang.Object[] getArgs()
public void setArgs(java.lang.Object... args)
public java.lang.reflect.Method getMethod()
public void setMethod(java.lang.reflect.Method m)
public static java.lang.reflect.Method findMethod(java.lang.Class target_class, java.lang.String method_name, java.lang.Object[] args) throws java.lang.Exception
java.lang.Exception
public java.lang.Object invoke(java.lang.Object target) throws java.lang.Exception
target
- - the object that you want to invoke the method onjava.lang.Exception
public java.lang.Object invoke(java.lang.Object target, java.lang.Object[] args) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringDetails()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
protected void writeArgs(java.io.DataOutput out) throws java.lang.Exception
java.lang.Exception
protected void readArgs(java.io.DataInput in) throws java.lang.Exception
java.lang.Exception
protected void writeTypes(java.io.DataOutput out) throws java.lang.Exception
java.lang.Exception
protected void readTypes(java.io.DataInput in) throws java.lang.Exception
java.lang.Exception
protected void writeMethod(java.io.DataOutput out) throws java.lang.Exception
java.lang.Exception
protected void readMethod(java.io.DataInput in) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object convert(java.lang.String arg, java.lang.Class<?> type)
public static boolean isPrimitiveType(java.lang.Class<?> type)
Copyright © 1998-2020 Red Hat. All Rights Reserved.