Class VMBridge

  • Direct Known Subclasses:
    VMBridge_jdk18

    public abstract class VMBridge
    extends java.lang.Object
    • Field Detail

      • instance

        static final VMBridge instance
    • Constructor Detail

      • VMBridge

        public VMBridge()
    • Method Detail

      • makeInstance

        private static VMBridge makeInstance()
      • getContext

        protected abstract Context getContext​(java.lang.Object contextHelper)
        Get Context instance associated with the current thread or null if none.
        Parameters:
        contextHelper - The result of getThreadContextHelper() called from the current thread.
      • setContext

        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.
        Parameters:
        contextHelper - The result of getThreadContextHelper() called from the current thread.
      • tryToMakeAccessible

        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). 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.
        Returns:
        true if it was possible to make method accessible or false otherwise.
      • getInterfaceProxyHelper

        protected abstract java.lang.Object getInterfaceProxyHelper​(ContextFactory cf,
                                                                    java.lang.Class<?>[] interfaces)
        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 });
         
        Parameters:
        interfaces - Array with one or more interface class objects.