Class SharedObjectMsg
java.lang.Object
org.eclipse.ecf.core.sharedobject.SharedObjectMsg
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RemoteCallImpl
Shared Object Message. Instances may be used for sending/receiving messages
among shared object replicas. This class can be used to create
SharedObjectMsg instances via one of
createMsg(String)
methods.- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
SharedObjectMsg
(String className, String methodName, Object[] parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check if it is permitted to alter the state of this message (args, class name, method name).static void
Check a given msg to verify that all Objects in args array implement the Serializable interface.static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
static SharedObjectMsg
createMsg
(String className, String methodName, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) protected final Method
findMethod
(Class clazz1) static Method
findMethod
(Class clazz, String meth, Class[] args) Find a Method instance on given class.protected final Method
findMethodRecursive
(Class clazz1) static Method
findMethodRecursive
(Class clazz, String meth, Class[] args) Find a Method instance on given class, and recursively search the class' superclass tree for given method.static Class
getClass
(ClassLoader loader, String name) Utility for getting a Class instance from a String class name.final String
final String
static String
getNameForClass
(Class clazz) Get name for given class.Object[]
protected Class[]
static Class[]
getTypesForParameters
(Object[] args) Get array of argument types from array of objectsfinal Object
static Method
searchForMethod
(Method[] meths, String meth, Class[] args) final void
setClassName
(String name) final void
final void
setParameters
(Object[] args) toString()
-
Field Details
-
nullArgs
-
nullTypes
-
clazz
-
method
-
parameters
-
-
Constructor Details
-
SharedObjectMsg
protected SharedObjectMsg() -
SharedObjectMsg
-
-
Method Details
-
createMsg
-
createMsg
-
createMsg
-
createMsg
-
createMsg
-
createMsg
-
createMsg
public static SharedObjectMsg createMsg(String className, String methodName, Object arg1, Object arg2) -
createMsg
-
createMsg
-
createMsg
-
getClass
Utility for getting a Class instance from a String class name. Calls Class.forName().- Parameters:
loader
- the ClassLoader to use to load the given classname
- of Class to load- Returns:
- Class instance found. If not found, a ClassNotFoundException is thrown
- Throws:
ClassNotFoundException
- thrown if specified class is not found
-
getNameForClass
Get name for given class.- Parameters:
clazz
- the Class to retrieve the name from- Returns:
- String name of given class
-
getTypesForParameters
Get array of argument types from array of objects- Parameters:
args
- the arguments to get types for- Returns:
- Class[] of types for objects in given Object array
-
findMethod
Find a Method instance on given class. This method searches for a method on the given class (first parameter), of the given name (second parameter), with arity defined by the third parameter. Calls searchForMethod to actually do the searching.- Parameters:
clazz
- the Class to look onmeth
- the method name to look forargs
- the arguments that will be passed to the method on the invoke call- Returns:
- Method instance found on given class. Null if none found.
-
searchForMethod
-
findMethodRecursive
Find a Method instance on given class, and recursively search the class' superclass tree for given method.- Parameters:
clazz
- the Class to look uponmeth
- the String name of the method to look forargs
- the array of Object arguments that will be passed to the method for execution- Returns:
- Method instance if found, null if not found
-
getMethod
-
setMethod
-
checkAlterMsg
protected void checkAlterMsg()Check if it is permitted to alter the state of this message (args, class name, method name). Default: NOP; subclasses should override as appropriate. To disallow, throw a java.lang.RuntimeException. -
getClassName
-
setClassName
-
getParameters
-
setParameters
-
getParameterTypes
-
findMethod
-
findMethodRecursive
-
invoke
- Throws:
Exception
-
toString
-