C# Класс Rhino.VMBridge

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
MakeInstance ( ) : VMBridge

Описание методов

GetContext() защищенный абстрактный Метод

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. ///
Результат Context

GetCurrentThreadClassLoader() защищенный абстрактный Метод

Return the ClassLoader instance associated with the current thread.
Return the ClassLoader instance associated with the current thread.
protected abstract GetCurrentThreadClassLoader ( ) : ClassLoader
Результат ClassLoader

GetInterfaceProxyHelper() защищенный Метод

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.
Результат object

GetJavaIterator() публичный Метод

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
Результат IEnumerator

GetThreadContextHelper() защищенный абстрактный Метод

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
Результат object

IsVarArgs() защищенный абстрактный Метод

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
Результат bool

NewInterfaceProxy() защищенный Метод

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
Результат object

SetContext() защищенный абстрактный Метод

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
Результат void

TryToMakeAccessible() защищенный абстрактный Метод

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
Результат bool