public interface WrappingProxy
Wrapper. It is usually used for
InvocationHandler to allow for unwrapping their wrapped object
instance. Unwrapping is required within the communication (a proxy may itself not be
serialisable) but also allows to unwrap localised objects and access the fields directly.
Subclasses which implement
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])
have to make sure that the methods of this interface are handled as normal method calls instead
of the interception logic for which the proxy exists.
| Modifier and Type | Method and Description |
|---|---|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Gets whether this
WrappingProxy wraps an object instance that is an instance of
the designated class. |
java.lang.Object |
unwrap()
Gets the object instance that is wrapped by this proxy.
|
<T> T |
unwrap(java.lang.Class<T> iface)
Gets an object instance that is an instance of the designated class.
|
java.lang.Object unwrap()
WrappingProxy again.null will never be returned.boolean isWrapperFor(java.lang.Class<?> iface)
WrappingProxy wraps an object instance that is an instance of
the designated class. This also applies transitively, that is, the wrapped object instance may
be a WrappingProxy that wraps an instance of the designated class.iface - The interface which to check for whether this proxy wraps an object instance of.WrappingProxy is an instance
(or a WrappingProxy) of the designated class/interface.<T> T unwrap(java.lang.Class<T> iface)
WrappingProxy) instance itself is an instance of this class, this will be
returned, thus not unwrapping. If neither this object instance nor the wrapped object instance
nor the possibly further wrapped object instances are instances of the designated class,
null will be returned.iface - The interface for which to get an unwrapped object instance of.null
will be returned.