public class VMBridge_jdk13 extends VMBridge
Constructor and Description |
---|
VMBridge_jdk13() |
Modifier and Type | Method and Description |
---|---|
protected Context |
getContext(Object contextHelper)
Get
Context instance associated with the current thread
or null if none. |
protected ClassLoader |
getCurrentThreadClassLoader()
Return the ClassLoader instance associated with the current thread.
|
protected Object |
getInterfaceProxyHelper(ContextFactory cf,
Class<?>[] interfaces)
Create helper object to create later proxies implementing the specified
interfaces later.
|
protected Object |
getThreadContextHelper()
Return a helper object to optimize
Context access. |
protected boolean |
isVarArgs(Member member)
Returns whether or not a given member (method or constructor)
has variable arguments.
|
protected Object |
newInterfaceProxy(Object proxyHelper,
ContextFactory cf,
InterfaceAdapter adapter,
Object target,
Scriptable topScope)
Create proxy object for
InterfaceAdapter . |
protected void |
setContext(Object contextHelper,
Context cx)
Associate
Context instance with the current thread or remove
the current association if cx is null. |
protected boolean |
tryToMakeAccessible(Object accessibleObject)
In many JVMSs, public methods in private
classes are not accessible by default (Sun Bug #4071593).
|
getJavaIterator
protected Object getThreadContextHelper()
VMBridge
Context
access.
The runtime will pass the resulting helper object to the subsequent
calls to VMBridge.getContext(Object contextHelper)
and
VMBridge.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.
getThreadContextHelper
in class VMBridge
protected Context getContext(Object contextHelper)
VMBridge
Context
instance associated with the current thread
or null if none.getContext
in class VMBridge
contextHelper
- The result of VMBridge.getThreadContextHelper()
called from the current thread.protected void setContext(Object contextHelper, Context cx)
VMBridge
Context
instance with the current thread or remove
the current association if cx is null.setContext
in class VMBridge
contextHelper
- The result of VMBridge.getThreadContextHelper()
called from the current thread.protected ClassLoader getCurrentThreadClassLoader()
VMBridge
getCurrentThreadClassLoader
in class VMBridge
protected boolean tryToMakeAccessible(Object accessibleObject)
VMBridge
tryToMakeAccessible
in class VMBridge
protected Object getInterfaceProxyHelper(ContextFactory cf, Class<?>[] interfaces)
VMBridge
return java.lang.reflect.Proxy.getProxyClass(..., interfaces). getConstructor(new Class[] { java.lang.reflect.InvocationHandler.class });
getInterfaceProxyHelper
in class VMBridge
interfaces
- Array with one or more interface class objects.protected Object newInterfaceProxy(Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, Object target, Scriptable topScope)
VMBridge
InterfaceAdapter
. The proxy should call
InterfaceAdapter.invoke(ContextFactory cf,
Object target,
Scriptable topScope,
Method method,
Object[] args)
as implementation of interface methods associated with
proxyHelper.newInterfaceProxy
in class VMBridge
proxyHelper
- The result of the previous call to
VMBridge.getInterfaceProxyHelper(ContextFactory, Class[])
.