| java.lang.Object org.apache.harmony.rmi.common.RMIUtil
RMIUtil | final public class RMIUtil (Code) | | Utility class for RMI implementation.
This class cannot be instantiated.
author: Mikhail A. Markov, Vasily Zakharov version: $Revision: 1.1.2.3 $ |
Method Summary | |
public static boolean | checkRemoteInterface(Class iface) Validates remote interface.
Particularly, checks that all methods throw
RemoteException .
Parameters: iface - Interface to validate. | public static String | getBasicMethodSignature(Method method) Returns basic method signature (method name and full parameters
class names) for the method.
Parameters: method - Method to get basic signature for. | public static String | getCanonicalName(Class cls) Returns canonical name for the class, e. | public static String | getExtendedMethodDescriptor(Method method) Returns extended method descriptor,
i. | public static String | getLongMethodSignature(Method method) Returns long method signature (return type, method name and full
parameters class names) for the method.
Parameters: method - Method to get long signature for. | public static String | getMethodDescriptor(Method method) Returns method descriptor as specified in section 4.3.3
of Virtual Machine Specification.
Parameters: method - Method to return descriptor for. | public static String | getPackageName(Class cls) Returns package name for the class.
Parameters: cls - Class to get package name for. | public static Class | getRemoteClass(Class cls) Finds the superclass of the specified class that directly implements
remote interface(s).
Parameters: cls - Class to check for remote superclass. | public static Class[] | getRemoteInterfaces(Class cls) Returns the list of implemented remote interfaces for the specified
class.
Parameters: cls - Class to return list of remote interfaces for. | public static String[] | getRemoteInterfacesNames(Class cls) Returns the string representation of the list of remote interfaces
implemented by the specified class.
Parameters: cls - Class to find remote interfaces for. | public static Map | getRemoteMethods(Class cls) Returns a map containing all remote methods of the specified class
(i. | public static String | getShortCanonicalName(Class cls) Returns short canonical name for the class, e. | public static String | getShortMethodSignature(Method method) Returns short method signature (without return type,
declaring class name or parameters package names) for the method.
Parameters: method - Method to get short signature for. | public static String | getShortName(Class cls) Returns short name for the class, e. | public static String | getSimpleName(Class cls) Returns simple name for the class, e. | public static String | getSystemName(Class cls) Returns system name for the class, e. | public static Class | getWrappingClass(Class cls) Returns wrapping Object class for specified primitive class.
Parameters: cls - Class to wrap. | public static boolean | isLocalHost(String hostName) Returns true if the specified hostName is a local host
and false otherwise.
Parameters: hostName - The name of the host to check. | public static boolean | isParentLoader(ClassLoader cl1, ClassLoader cl2) Returns true if the first specified class loader
is a parent class loader (or equal) to the second specified class loader
and false otherwise.
Parameters: cl1 - First class loader. Parameters: cl2 - Second class loader. |
checkRemoteInterface | public static boolean checkRemoteInterface(Class iface) throws IllegalArgumentException(Code) | | Validates remote interface.
Particularly, checks that all methods throw
RemoteException .
Parameters: iface - Interface to validate. true if the specified class is a valid remoteinterface, false if the specified class is nota remote interface. throws: IllegalArgumentException - If specified class is not an interface or if it implementsjava.rmi.Remote but is not a valid remote interface. |
getBasicMethodSignature | public static String getBasicMethodSignature(Method method)(Code) | | Returns basic method signature (method name and full parameters
class names) for the method.
Parameters: method - Method to get basic signature for. Basic method signature (method name and full parametersclass names) for the method. For example, for this particularmethod the long signature will be: "getBasicMethodSignature(java.lang.reflect.Method)" . |
getCanonicalName | public static String getCanonicalName(Class cls)(Code) | | Returns canonical name for the class, e. g. full class name with
package name, with [] appended to the end for array types.
Handles local classes correctly.
Parameters: cls - Class to get canonical name for. Canonical name of the class. |
getExtendedMethodDescriptor | public static String getExtendedMethodDescriptor(Method method)(Code) | | Returns extended method descriptor,
i. e. method name appended with method descriptor
as specified in section 4.3.3
of Virtual Machine Specification.
Parameters: method - Method to return extended descriptor for. Extended method descriptor. |
getLongMethodSignature | public static String getLongMethodSignature(Method method)(Code) | | Returns long method signature (return type, method name and full
parameters class names) for the method.
Parameters: method - Method to get long signature for. Long method signature (return type, method name and fullparameters class names) for the method. For example, for thisparticular method the long signature will be: "java.lang.StringgetLongMethodSignature(java.lang.reflect.Method)" . |
getMethodDescriptor | public static String getMethodDescriptor(Method method)(Code) | | Returns method descriptor as specified in section 4.3.3
of Virtual Machine Specification.
Parameters: method - Method to return descriptor for. Method descriptor. |
getPackageName | public static String getPackageName(Class cls)(Code) | | Returns package name for the class.
Parameters: cls - Class to get package name for. Package name of the class,or null if class does not belong to a package. |
getRemoteClass | public static Class getRemoteClass(Class cls) throws IllegalArgumentException(Code) | | Finds the superclass of the specified class that directly implements
remote interface(s).
Parameters: cls - Class to check for remote superclass. The class found. throws: IllegalArgumentException - If the specified class is not remote. |
getRemoteInterfaces | public static Class[] getRemoteInterfaces(Class cls) throws IllegalArgumentException(Code) | | Returns the list of implemented remote interfaces for the specified
class.
Parameters: cls - Class to return list of remote interfaces for. Array of remote interfaces implemented by the specified class.May be empty if the specified class is not a remote classor if cls is null . throws: IllegalArgumentException - If class implements any invalid remote interfaces. |
getRemoteInterfacesNames | public static String[] getRemoteInterfacesNames(Class cls) throws IllegalArgumentException(Code) | | Returns the string representation of the list of remote interfaces
implemented by the specified class.
Parameters: cls - Class to find remote interfaces for. List of remote interfaces for the specified class. throws: IllegalArgumentException - If some error occurred while creating the list. |
getRemoteMethods | public static Map getRemoteMethods(Class cls) throws RMIHashException(Code) | | Returns a map containing all remote methods of the specified class
(i. e. all methods contained in
Remote interfaces implemented
by the class). Hashes of methods are keys in this map.
Parameters: cls - Class to list remote methods for. Map containing all the remote methods of the specified classand having method hashes as keys. throws: RMIHashException - If error occurred while calculating method hash. |
getShortCanonicalName | public static String getShortCanonicalName(Class cls)(Code) | | Returns short canonical name for the class, e. g. short class name
without package name (but with '.' symbols for local classes),
with [] appended to the end for array types.
Parameters: cls - Class to get short canonical name for. Short canonical name of the class. |
getShortMethodSignature | public static String getShortMethodSignature(Method method)(Code) | | Returns short method signature (without return type,
declaring class name or parameters package names) for the method.
Parameters: method - Method to get short signature for. Short method signature (without return type,declaring class name or parameters package names)for the method. For example, for this particular methodthe short signature will be:"getShortMethodSignature(Method)" . |
getShortName | public static String getShortName(Class cls)(Code) | | Returns short name for the class, e. g. short class name without
package name (but with '$' symbols for local classes),
with [] appended to the end for array types.
Parameters: cls - Class to get short name for. Short name of the class. |
getSimpleName | public static String getSimpleName(Class cls)(Code) | | Returns simple name for the class, e. g. short class name without
package name or declaring class name, with [] appended
to the end for array types.
Parameters: cls - Class to get simple name for. Simple name of the class. |
getSystemName | public static String getSystemName(Class cls)(Code) | | Returns system name for the class, e. g.
I for int ,
[[B for boolean[][] ,
[Ljava/lang/String; for String[] .
Parameters: cls - Class to get system name for. System name of the class. |
getWrappingClass | public static Class getWrappingClass(Class cls)(Code) | | Returns wrapping Object class for specified primitive class.
Parameters: cls - Class to wrap. Wrapping Object class for cls , if cls is Object class itself (e. g. Vector ),cls itself is returned, for primitive types(e. g. int ) the respective wrapping Object classis returned (in case of int , Integer). |
isLocalHost | public static boolean isLocalHost(String hostName) throws UnknownHostException(Code) | | Returns true if the specified hostName is a local host
and false otherwise.
Parameters: hostName - The name of the host to check. true if the specified hostName is a local hostand false otherwise. throws: UnknownHostException - If the specified host name could not be resolved. |
isParentLoader | public static boolean isParentLoader(ClassLoader cl1, ClassLoader cl2)(Code) | | Returns true if the first specified class loader
is a parent class loader (or equal) to the second specified class loader
and false otherwise.
Parameters: cl1 - First class loader. Parameters: cl2 - Second class loader. true if the first class loader is a parent(or equal) to the second class loader. |
|
|