org.mozilla.javascript
public abstract class VMBridge extends Object
Method Summary | |
---|---|
protected abstract Context | getContext(Object contextHelper)
Get {@link Context} instance associated with the current thread
or null if none.
|
protected abstract 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 abstract Object | getThreadContextHelper()
Return a helper object to optimize {@link Context} access.
|
protected Object | newInterfaceProxy(Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, Object target, Scriptable topScope)
Create proxy object for {@link InterfaceAdapter}. |
protected abstract void | setContext(Object contextHelper, Context cx)
Associate {@link Context} instance with the current thread or remove
the current association if cx is null.
|
protected abstract boolean | tryToMakeAccessible(Object accessibleObject)
In many JVMSs, public methods in private
classes are not accessible by default (Sun Bug #4071593).
|
Parameters: contextHelper The result of {@link getThreadContextHelper()} called from the current thread.
return java.lang.reflect.Proxy.getProxyClass(..., interfaces). getConstructor(new Class[] { java.lang.reflect.InvocationHandler.class });
Parameters: interfaces Array with one or more interface class objects.
The runtime will pass the resulting helper object to the subsequent calls to {@link #getContext(Object contextHelper)} and {@link #setContext(Object contextHelper, Context cx)} methods. In this way the implementation can use the helper to cache information about current thread to make {@link Context} access faster.
Parameters: proxyHelper The result of the previous call to {@link #getInterfaceProxyHelper(ContextFactory, Class[]).
Parameters: contextHelper The result of {@link getThreadContextHelper()} called from the current thread.
Returns: true if it was possible to make method accessible or false otherwise.