public class MethodCall extends Object implements Streamable, Constructable<MethodCall>
Modifier and Type | Field and Description |
---|---|
protected Object[] |
args |
protected static short |
ID |
protected Method |
method |
protected static short |
METHOD |
protected short |
method_id |
protected String |
method_name |
protected short |
mode |
protected Class[] |
types |
protected static short |
TYPES |
Constructor and Description |
---|
MethodCall()
Needed for deserialization
|
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 |
---|---|
Object[] |
args() |
MethodCall |
args(Object... args) |
Supplier<? extends MethodCall> |
create()
Creates an instance of the class implementing this interface
|
static Method |
findMethod(Class target_class,
String method_name,
Object[] args)
Called by the ProbeHandler impl.
|
protected static Method[] |
getAllMethods(Class target)
The method walks up the class hierarchy and returns all methods of this class
and those inherited from superclasses and superinterfaces.
|
Object[] |
getArgs() |
Method |
getMethod() |
protected static Method |
getMethod(Class target,
String methodName,
Class[] types)
Returns the first method that matches the specified name and parameter types.
|
short |
getMethodId() |
String |
getMethodName() |
int |
getMode() |
protected void |
init(Method method) |
Object |
invoke(Object target)
Invokes the method with the supplied arguments against the target object.
|
Object |
invoke(Object target,
Object[] args) |
protected static boolean |
isPrimitiveType(Class<?> type) |
Method |
method() |
MethodCall |
method(Method m) |
short |
methodId() |
MethodCall |
methodId(short id) |
String |
methodName() |
MethodCall |
methodName(String n) |
int |
mode() |
protected void |
readArgs(DataInput in,
Marshaller marshaller) |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
void |
readFrom(DataInput in,
Marshaller marshaller) |
protected void |
readMethod(DataInput in) |
protected void |
readTypes(DataInput in) |
MethodCall |
setArgs(Object... args) |
MethodCall |
setMethod(Method m) |
MethodCall |
setMethodId(short id) |
MethodCall |
setMethodName(String n) |
String |
toString() |
String |
toStringDetails() |
protected void |
writeArgs(DataOutput out,
Marshaller marshaller) |
protected void |
writeMethod(DataOutput out) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
void |
writeTo(DataOutput out,
Marshaller marshaller) |
protected void |
writeTypes(DataOutput out) |
protected short mode
protected String method_name
protected short method_id
protected Object[] args
protected Class[] types
protected Method method
protected static final short METHOD
protected static final short TYPES
protected static final short ID
public MethodCall()
public MethodCall(short method_id, Object... args)
public Supplier<? extends MethodCall> create()
Constructable
create
in interface Constructable<MethodCall>
public int getMode()
public int mode()
public String getMethodName()
public String methodName()
public MethodCall setMethodName(String n)
public MethodCall methodName(String n)
public short getMethodId()
public short methodId()
public MethodCall setMethodId(short id)
public MethodCall methodId(short id)
public Object[] getArgs()
public Object[] args()
public MethodCall args(Object... args)
public MethodCall setArgs(Object... args)
public Method getMethod()
public Method method()
public MethodCall setMethod(Method m)
public MethodCall method(Method m)
public Object invoke(Object target) throws Exception
target
- - the object that you want to invoke the method onException
public static Method findMethod(Class target_class, String method_name, Object[] args) throws Exception
Exception
public String toStringDetails()
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
Exception
public void writeTo(DataOutput out, Marshaller marshaller) throws Exception
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
Exception
public void readFrom(DataInput in, Marshaller marshaller) throws Exception
Exception
protected void init(Method method)
protected static Method getMethod(Class target, String methodName, Class[] types)
protected void writeArgs(DataOutput out, Marshaller marshaller) throws Exception
Exception
protected void readArgs(DataInput in, Marshaller marshaller) throws Exception
Exception
protected void writeTypes(DataOutput out) throws Exception
Exception
protected void writeMethod(DataOutput out) throws Exception
Exception
protected static Method[] getAllMethods(Class target)
protected static boolean isPrimitiveType(Class<?> type)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.