InvocationHandler interface for
use with Java Remote Method Invocation (Java RMI). This invocation
handler can be used in conjunction with a dynamic proxy instance as a
replacement for a pregenerated stub class.
Applications are not expected to use this class directly. A remote
object exported to use a dynamic proxy with UnicastRemoteObject
has an instance of this class as that proxy's invocation handler.
| Modifier and Type | Class and Description |
|---|---|
| private static class | RemoteObjectInvocationHandler.
A weak hash map, mapping classes to weak hash maps that map method objects to method hashes. |
| Modifier and Type | Field and Description |
|---|---|
| private static final RemoteObjectInvocationHandler. | methodToHash_Maps
A weak hash map, mapping classes to weak hash maps that map method objects to method hashes. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | RemoteObjectInvocationHandler(RemoteRef
the remote ref ref)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private static long | Returns: the method hash for the specified methodthe remote method method)Returns the method hash for the specified method. |
| public Object | Returns: the value to return from the method invocation on the proxy instancethe proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to the
interface method invoked on the proxy instancean array of objects containing the values of the
arguments passed in the method invocation on the proxy instance, or
args)null if the method takes no argumentsImplements java. Processes a method invocation made on the encapsulating
proxy instance, |
| private Object | |
| private Object | |
| private String | proxyToString(Object proxy)
Returns a string representation for a proxy that uses this invocation handler. |
| private void |
| methodToHash_Maps | back to summary |
|---|---|
| private static final RemoteObjectInvocationHandler. A weak hash map, mapping classes to weak hash maps that map method objects to method hashes. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| RemoteObjectInvocationHandler | back to summary |
|---|---|
| public RemoteObjectInvocationHandler(RemoteRef ref) Creates a new
| |
| getMethodHash | back to summary |
|---|---|
| private static long getMethodHash(Method method) Returns the method hash for the specified method. Subsequent calls to "getMethodHash" passing the same method argument should be faster since this method caches internally the result of the method to method hash mapping. The method hash is calculated using the "computeMethodHash" method.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Processes a method invocation made on the encapsulating
proxy instance,
If
If Otherwise, a remote call is made as follows:
The semantics of this method are unspecified if the arguments could not have been produced by an instance of some valid dynamic proxy class containing this invocation handler.
| |
| invokeObjectMethod | back to summary |
|---|---|
| private Object invokeObjectMethod(Object proxy, Method method, Object[] args) Handles java.lang.Object methods. | |
| invokeRemoteMethod | back to summary |
|---|---|
| private Object invokeRemoteMethod(Object proxy, Method method, Object[] args) throws Exception Handles remote methods. | |
| proxyToString | back to summary |
|---|---|
| private String proxyToString(Object proxy) Returns a string representation for a proxy that uses this invocation handler. | |
| readObjectNoData | back to summary |
|---|---|
private void readObjectNoData() throws InvalidObjectException
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected Map |
| MethodToHash_Maps | back to summary |
|---|---|
| pack-priv MethodToHash_Maps() | |
| computeValue | back to summary |
|---|---|
| protected Map Implements abstract sun. | |