public final class

Util

extends Object
java.lang.Object
   ↳ sun.rmi.server.Util

Class Overview

A utility class with static methods for creating stubs/proxies and skeletons for remote objects.

Summary

Fields
public static final Log serverRefLog server reference log
Public Methods
static long computeMethodHash(Method m)
Compute the "method hash" of a remote method.
static Remote createProxy(Class implClass, RemoteRef clientRef, boolean forceStubUse)
Returns a proxy for the specified implClass.
static String getUnqualifiedName(Class c)
Returns the binary name of the given type without package qualification.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Log serverRefLog

server reference log

Public Methods

public static long computeMethodHash (Method m)

Compute the "method hash" of a remote method. The method hash is a long containing the first 64 bits of the SHA digest from the UTF encoded string of the method name and descriptor.

public static Remote createProxy (Class implClass, RemoteRef clientRef, boolean forceStubUse)

Returns a proxy for the specified implClass. If both of the following criteria is satisfied, a dynamic proxy for the specified implClass is returned (otherwise a RemoteStub instance for the specified implClass is returned): a) either the property java.rmi.server.ignoreStubClasses is true or a pregenerated stub class does not exist for the impl class, and b) forceStubUse is false. If the above criteria are satisfied, this method constructs a dynamic proxy instance (that implements the remote interfaces of implClass) constructed with a RemoteObjectInvocationHandler instance constructed with the clientRef. Otherwise, this method loads the pregenerated stub class (which extends RemoteStub and implements the remote interfaces of implClass) and constructs an instance of the pregenerated stub class with the clientRef.

Parameters
implClass the class to obtain remote interfaces from
clientRef the remote ref to use in the invocation handler
forceStubUse if true, forces creation of a RemoteStub
Throws
IllegalArgumentException if implClass implements illegal remote interfaces
StubNotFoundException if problem locating/creating stub or creating the dynamic proxy instance

public static String getUnqualifiedName (Class c)

Returns the binary name of the given type without package qualification. Nested types are treated no differently from top-level types, so for a nested type, the returned name will still be qualified with the simple name of its enclosing top-level type (and perhaps other enclosing types), the separator will be '$', etc.