Package org.mozilla.javascript.jdk13
Class VMBridge_jdk13
- java.lang.Object
-
- org.mozilla.javascript.VMBridge
-
- org.mozilla.javascript.jdk13.VMBridge_jdk13
-
- Direct Known Subclasses:
VMBridge_jdk15
public class VMBridge_jdk13 extends VMBridge
-
-
Constructor Summary
Constructors Constructor Description VMBridge_jdk13()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContextgetContext(java.lang.Object contextHelper)GetContextinstance associated with the current thread or null if none.protected java.lang.ClassLoadergetCurrentThreadClassLoader()Return the ClassLoader instance associated with the current thread.protected java.lang.ObjectgetInterfaceProxyHelper(ContextFactory cf, java.lang.Class<?>[] interfaces)Create helper object to create later proxies implementing the specified interfaces later.protected java.lang.ObjectgetThreadContextHelper()Return a helper object to optimizeContextaccess.protected booleanisVarArgs(java.lang.reflect.Member member)Returns whether or not a given member (method or constructor) has variable arguments.protected java.lang.ObjectnewInterfaceProxy(java.lang.Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, java.lang.Object target, Scriptable topScope)Create proxy object forInterfaceAdapter.protected voidsetContext(java.lang.Object contextHelper, Context cx)AssociateContextinstance with the current thread or remove the current association if cx is null.protected booleantryToMakeAccessible(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
getJavaIterator
-
-
-
-
Method Detail
-
getThreadContextHelper
protected java.lang.Object getThreadContextHelper()
Description copied from class:VMBridgeReturn a helper object to optimizeContextaccess.The runtime will pass the resulting helper object to the subsequent calls to
VMBridge.getContext(Object contextHelper)andVMBridge.setContext(Object contextHelper, Context cx)methods. In this way the implementation can use the helper to cache information about current thread to makeContextaccess faster.- Specified by:
getThreadContextHelperin classVMBridge
-
getContext
protected Context getContext(java.lang.Object contextHelper)
Description copied from class:VMBridgeGetContextinstance associated with the current thread or null if none.- Specified by:
getContextin classVMBridge- Parameters:
contextHelper- The result ofVMBridge.getThreadContextHelper()called from the current thread.
-
setContext
protected void setContext(java.lang.Object contextHelper, Context cx)Description copied from class:VMBridgeAssociateContextinstance with the current thread or remove the current association if cx is null.- Specified by:
setContextin classVMBridge- Parameters:
contextHelper- The result ofVMBridge.getThreadContextHelper()called from the current thread.
-
getCurrentThreadClassLoader
protected java.lang.ClassLoader getCurrentThreadClassLoader()
Description copied from class:VMBridgeReturn the ClassLoader instance associated with the current thread.- Specified by:
getCurrentThreadClassLoaderin classVMBridge
-
tryToMakeAccessible
protected boolean tryToMakeAccessible(java.lang.Object accessibleObject)
Description copied from class:VMBridgeIn 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:
tryToMakeAccessiblein classVMBridge- 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:VMBridgeCreate 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 });- Overrides:
getInterfaceProxyHelperin classVMBridgeinterfaces- Array with one or more interface class objects.
-
newInterfaceProxy
protected java.lang.Object newInterfaceProxy(java.lang.Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, java.lang.Object target, Scriptable topScope)Description copied from class:VMBridgeCreate proxy object forInterfaceAdapter. The proxy should callInterfaceAdapter#invoke(ContextFactory, Object, Scriptable, Method, Object[])as implementation of interface methods associated with proxyHelper.Method- Overrides:
newInterfaceProxyin classVMBridge- Parameters:
proxyHelper- The result of the previous call toVMBridge.getInterfaceProxyHelper(ContextFactory, Class[]).
-
isVarArgs
protected boolean isVarArgs(java.lang.reflect.Member member)
Description copied from class:VMBridgeReturns 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.
-
-