org.mozilla.javascript.jdk11
Class VMBridge_jdk11

java.lang.Object
  extended by org.mozilla.javascript.VMBridge
      extended by org.mozilla.javascript.jdk11.VMBridge_jdk11

public class VMBridge_jdk11
extends VMBridge


Constructor Summary
VMBridge_jdk11()
           
 
Method Summary
protected  Context getContext(java.lang.Object contextHelper)
          Get Context instance associated with the current thread or null if none.
protected  java.lang.ClassLoader getCurrentThreadClassLoader()
          Return the ClassLoader instance associated with the current thread.
protected  java.lang.Object getThreadContextHelper()
          Return a helper object to optimize Context access.
protected  boolean isVarArgs(java.lang.reflect.Member member)
          Returns whether or not a given member (method or constructor) has variable arguments.
protected  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  boolean tryToMakeAccessible(java.lang.Object accessibleObject)
          In many JVMSs, public methods in private classes are not accessible by default (Sun Bug #4071593).
 
Methods inherited from class org.mozilla.javascript.VMBridge
getInterfaceProxyHelper, getJavaIterator, newInterfaceProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMBridge_jdk11

public VMBridge_jdk11()
Method Detail

getThreadContextHelper

protected java.lang.Object getThreadContextHelper()
Description copied from class: VMBridge
Return a helper object to optimize 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.

Specified by:
getThreadContextHelper in class VMBridge

getContext

protected Context getContext(java.lang.Object contextHelper)
Description copied from class: VMBridge
Get Context instance associated with the current thread or null if none.

Specified by:
getContext in class VMBridge
Parameters:
contextHelper - The result of VMBridge.getThreadContextHelper() called from the current thread.

setContext

protected void setContext(java.lang.Object contextHelper,
                          Context cx)
Description copied from class: VMBridge
Associate Context instance with the current thread or remove the current association if cx is null.

Specified by:
setContext in class VMBridge
Parameters:
contextHelper - The result of VMBridge.getThreadContextHelper() called from the current thread.

getCurrentThreadClassLoader

protected java.lang.ClassLoader getCurrentThreadClassLoader()
Description copied from class: VMBridge
Return the ClassLoader instance associated with the current thread.

Specified by:
getCurrentThreadClassLoader in class VMBridge

tryToMakeAccessible

protected boolean tryToMakeAccessible(java.lang.Object accessibleObject)
Description copied from class: VMBridge
In many JVMSs, public methods in private classes are not accessible by default (Sun Bug #4071593). VMBridge instance should try to workaround that via, for example, calling method.setAccessible(true) when it is available. The implementation is responsible to catch all possible exceptions like SecurityException if the workaround is not available.

Specified by:
tryToMakeAccessible in class VMBridge
Returns:
true if it was possible to make method accessible or false otherwise.

isVarArgs

protected boolean isVarArgs(java.lang.reflect.Member member)
Description copied from class: VMBridge
Returns whether or not a given member (method or constructor) has variable arguments. Variable argument methods have only been supported in Java since JDK 1.5.

Specified by:
isVarArgs in class VMBridge