C# Class Rhino.VMBridge

Afficher le fichier Open project: hazzik/Rhino.Net

Méthodes publiques

Méthode Description
GetJavaIterator ( Context cx, Scriptable scope, object obj ) : IEnumerator

If "obj" is a java.util.Iterator or a java.lang.Iterable, return a wrapping as a JavaScript Iterator.

If "obj" is a java.util.Iterator or a java.lang.Iterable, return a wrapping as a JavaScript Iterator. Otherwise, return null. This method is in VMBridge since Iterable is a JDK 1.5 addition.

Méthodes protégées

Méthode Description
GetContext ( object contextHelper ) : Context

Get Context instance associated with the current thread or null if none.

GetCurrentThreadClassLoader ( ) : ClassLoader

Return the ClassLoader instance associated with the current thread.

Return the ClassLoader instance associated with the current thread.

GetInterfaceProxyHelper ( ContextFactory cf, Type interfaces ) : object

Create helper object to create later proxies implementing the specified interfaces later.

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 }); 
GetThreadContextHelper ( ) : object

Return a helper object to optimize Context access.

The runtime will pass the resulting helper object to the subsequent calls to GetContext(object) and SetContext(object, Context) methods. In this way the implementation can use the helper to cache information about current thread to make Context access faster.

IsVarArgs ( MemberInfo member ) : bool

Returns whether or not a given member (method or constructor) has variable arguments.

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.

NewInterfaceProxy ( object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, object target, Scriptable topScope ) : object

Create proxy object for InterfaceAdapter . The proxy should call InterfaceAdapter.Invoke(ContextFactory, object, Scriptable, object, System.Reflection.MethodInfo, object[]) as implementation of interface methods associated with proxyHelper.

SetContext ( object contextHelper, Context cx ) : void

Associate Context instance with the current thread or remove the current association if cx is null.

TryToMakeAccessible ( object accessibleObject ) : bool

In many JVMSs, public methods in private classes are not accessible by default (Sun Bug #4071593).

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.

Private Methods

Méthode Description
MakeInstance ( ) : VMBridge

Method Details

GetContext() protected abstract méthode

Get Context instance associated with the current thread or null if none.
protected abstract GetContext ( object contextHelper ) : Context
contextHelper object /// The result of /// GetThreadContextHelper() /// called from the current thread. ///
Résultat Context

GetCurrentThreadClassLoader() protected abstract méthode

Return the ClassLoader instance associated with the current thread.
Return the ClassLoader instance associated with the current thread.
protected abstract GetCurrentThreadClassLoader ( ) : ClassLoader
Résultat ClassLoader

GetInterfaceProxyHelper() protected méthode

Create helper object to create later proxies implementing the specified interfaces later.
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 }); 
protected GetInterfaceProxyHelper ( ContextFactory cf, Type interfaces ) : object
cf ContextFactory
interfaces System.Type Array with one or more interface class objects.
Résultat object

GetJavaIterator() public méthode

If "obj" is a java.util.Iterator or a java.lang.Iterable, return a wrapping as a JavaScript Iterator.
If "obj" is a java.util.Iterator or a java.lang.Iterable, return a wrapping as a JavaScript Iterator. Otherwise, return null. This method is in VMBridge since Iterable is a JDK 1.5 addition.
public GetJavaIterator ( Context cx, Scriptable scope, object obj ) : IEnumerator
cx Context
scope Scriptable
obj object
Résultat IEnumerator

GetThreadContextHelper() protected abstract méthode

Return a helper object to optimize Context access.

The runtime will pass the resulting helper object to the subsequent calls to GetContext(object) and SetContext(object, Context) methods. In this way the implementation can use the helper to cache information about current thread to make Context access faster.

protected abstract GetThreadContextHelper ( ) : object
Résultat object

IsVarArgs() protected abstract méthode

Returns whether or not a given member (method or constructor) has variable arguments.
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.
protected abstract IsVarArgs ( MemberInfo member ) : bool
member System.Reflection.MemberInfo
Résultat bool

NewInterfaceProxy() protected méthode

Create proxy object for InterfaceAdapter . The proxy should call InterfaceAdapter.Invoke(ContextFactory, object, Scriptable, object, System.Reflection.MethodInfo, object[]) as implementation of interface methods associated with proxyHelper.
protected NewInterfaceProxy ( object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, object target, Scriptable topScope ) : object
proxyHelper object /// The result of the previous call to /// GetInterfaceProxyHelper(ContextFactory, System.Type<T>[]) /// . ///
cf ContextFactory
adapter InterfaceAdapter
target object
topScope Scriptable
Résultat object

SetContext() protected abstract méthode

Associate Context instance with the current thread or remove the current association if cx is null.
protected abstract SetContext ( object contextHelper, Context cx ) : void
contextHelper object /// The result of /// GetThreadContextHelper() /// called from the current thread. ///
cx Context
Résultat void

TryToMakeAccessible() protected abstract méthode

In many JVMSs, public methods in private classes are not accessible by default (Sun Bug #4071593).
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.
protected abstract TryToMakeAccessible ( object accessibleObject ) : bool
accessibleObject object
Résultat bool