public abstract class VMBridge
extends java.lang.Object
Constructor and Description |
---|
VMBridge() |
Modifier and Type | Method and Description |
---|---|
protected abstract Context |
getContext(java.lang.Object contextHelper)
Get
Context instance associated with the current thread
or null if none. |
protected abstract java.lang.Object |
getInterfaceProxyHelper(ContextFactory cf,
java.lang.Class<?>[] interfaces)
Create helper object to create later proxies implementing the specified
interfaces later.
|
protected abstract java.lang.Object |
getThreadContextHelper()
Return a helper object to optimize
Context access. |
protected abstract java.lang.Object |
newInterfaceProxy(java.lang.Object proxyHelper,
ContextFactory cf,
InterfaceAdapter adapter,
java.lang.Object target,
Scriptable topScope)
Create proxy object for
InterfaceAdapter . |
protected abstract void |
setContext(java.lang.Object contextHelper,
Context cx)
Associate
Context instance with the current thread or remove
the current association if cx is null. |
protected abstract boolean |
tryToMakeAccessible(java.lang.reflect.AccessibleObject accessible)
In many JVMSs, public methods in private
classes are not accessible by default (Sun Bug #4071593).
|
protected abstract java.lang.Object getThreadContextHelper()
Context
access.
The runtime will pass the resulting helper object to the subsequent
calls to getContext(Object contextHelper)
and
setContext(Object contextHelper, Context cx)
methods.
In this way the implementation can use the helper to cache
information about current thread to make Context
access faster.
protected abstract Context getContext(java.lang.Object contextHelper)
Context
instance associated with the current thread
or null if none.contextHelper
- The result of getThreadContextHelper()
called from the current thread.protected abstract void setContext(java.lang.Object contextHelper, Context cx)
Context
instance with the current thread or remove
the current association if cx
is null.contextHelper
- The result of getThreadContextHelper()
called from the current thread.protected abstract boolean tryToMakeAccessible(java.lang.reflect.AccessibleObject accessible)
protected abstract java.lang.Object getInterfaceProxyHelper(ContextFactory cf, java.lang.Class<?>[] interfaces)
return java.lang.reflect.Proxy.getProxyClass(..., interfaces). getConstructor(new Class[] { java.lang.reflect.InvocationHandler.class });
interfaces
- Array with one or more interface class objects.protected abstract java.lang.Object newInterfaceProxy(java.lang.Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, java.lang.Object target, Scriptable topScope)
InterfaceAdapter
. The proxy should call
InterfaceAdapter.invoke(ContextFactory, Object, Scriptable,
Object, Method, Object[])
as implementation of interface methods associated with
proxyHelper
. Method
proxyHelper
- The result of the previous call to
getInterfaceProxyHelper(ContextFactory, Class[])
.