Class VMBridge_jdk18


  • public class VMBridge_jdk18
    extends VMBridge
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.ThreadLocal<java.lang.Object[]> contextLocal  
    • Constructor Summary

      Constructors 
      Constructor Description
      VMBridge_jdk18()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Context getContext​(java.lang.Object contextHelper)
      Get Context instance associated with the current thread or null if none.
      protected java.lang.Object getInterfaceProxyHelper​(ContextFactory cf, java.lang.Class<?>[] interfaces)
      Create helper object to create later proxies implementing the specified interfaces later.
      protected java.lang.Object getThreadContextHelper()
      Return a helper object to optimize Context access.
      protected java.lang.Object newInterfaceProxy​(java.lang.Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, java.lang.Object target, Scriptable topScope)
      Create proxy object for InterfaceAdapter.
      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.reflect.AccessibleObject accessible)
      In many JVMSs, public methods in private classes are not accessible by default (Sun Bug #4071593).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • contextLocal

        private static final java.lang.ThreadLocal<java.lang.Object[]> contextLocal
    • Constructor Detail

      • VMBridge_jdk18

        public VMBridge_jdk18()
    • Method Detail

      • 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.
      • tryToMakeAccessible

        protected boolean tryToMakeAccessible​(java.lang.reflect.AccessibleObject accessible)
        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.
      • getInterfaceProxyHelper

        protected java.lang.Object getInterfaceProxyHelper​(ContextFactory cf,
                                                           java.lang.Class<?>[] interfaces)
        Description copied from class: VMBridge
        Create helper object to create later proxies implementing the specified interfaces later. Under JDK 1.3 the implementation can look like:
         return java.lang.reflect.Proxy.getProxyClass(..., interfaces).
             getConstructor(new Class[] {
                 java.lang.reflect.InvocationHandler.class });
         
        Specified by:
        getInterfaceProxyHelper in class VMBridge
        interfaces - Array with one or more interface class objects.