- java.lang.Object
-
- org.ojalgo.concurrent.MethodDescriptor
-
- All Implemented Interfaces:
java.io.Serializable
public final class MethodDescriptor extends java.lang.Object implements java.io.SerializableDescription of a (static) method to invoke in a child JVM. Uses type names internally to avoid ClassLoader mismatches.In Java, a method is identified for reflective lookup by its name and parameter types only. The return type is not used to resolve a method and cannot disambiguate overloads (two methods cannot differ only by return type).
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmyClassNameprivate java.lang.reflect.MethodmyMethodprivate java.lang.StringmyMethodNameprivate java.lang.String[]myParameterTypeNamesprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description MethodDescriptor(java.lang.String className, java.lang.String methodName, java.lang.String[] parameterTypeNames)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.MethodgetMethod()static MethodDescriptorof(java.lang.Class<?> owner, java.lang.String name, java.lang.Class<?>... parameters)static MethodDescriptorof(java.lang.reflect.Method method)Create a descriptor from a reflectiveMethod.private static java.lang.String[]typeNames(java.lang.Class<?>[] types)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
myClassName
private final java.lang.String myClassName
-
myMethod
private transient java.lang.reflect.Method myMethod
-
myMethodName
private final java.lang.String myMethodName
-
myParameterTypeNames
private final java.lang.String[] myParameterTypeNames
-
-
Method Detail
-
of
public static MethodDescriptor of(java.lang.Class<?> owner, java.lang.String name, java.lang.Class<?>... parameters)
-
of
public static MethodDescriptor of(java.lang.reflect.Method method)
Create a descriptor from a reflectiveMethod. Parameter types are taken as declared (including varargs represented as an array type). The return type is intentionally not included as it is not used for reflective lookup.The method must be
staticwhen used withExternalProcessExecutor.
-
typeNames
private static java.lang.String[] typeNames(java.lang.Class<?>[] types)
-
getMethod
public java.lang.reflect.Method getMethod() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.SecurityException- Throws:
java.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.SecurityException
-
-