Note
This module relies on new features of JDK1.3 and will not compile with JDK1.2 or lower. For those environments simply do not compile this class. Eventually XThis should become simply This, but for backward compatability we will maintain This without requiring support for the proxy mechanism. XThis stands for "eXtended This" (I had to call it something).
See also JThis with explicit JFC support for compatability., This
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | XThis.Handler
This is the invocation handler for the dynamic proxy. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Hashtable | interfaces
A cache of proxy interface handlers. |
| pack-priv InvocationHandler |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getInterface(Class<T> clas)
Overrides bsh. |
| public Object | getInterface(Class<T>[] ca)
Overrides bsh. |
| public String |
| interfaces | back to summary |
|---|---|
| pack-priv Hashtable<K, V> interfaces A cache of proxy interface handlers. Currently just one per interface. | |
| invocationHandler | back to summary |
|---|---|
| pack-priv InvocationHandler invocationHandler | |
| XThis | back to summary |
|---|---|
| public XThis(NameSpace namespace, Interpreter declaringInterp) | |
| getInterface | back to summary |
|---|---|
| public Object getInterface(Class<T> clas) Overrides bsh. Get dynamic proxy for interface, caching those it creates. | |
| getInterface | back to summary |
|---|---|
| public Object getInterface(Class<T>[] ca) Overrides bsh. Get dynamic proxy for interface, caching those it creates. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides bsh. Doc from java. Returns a string representation of the object.
| |
Notes
Inner class for the invocation handler seems to shield this unavailable interface from JDK1.2 VM... I don't understand this. JThis works just fine even if those classes aren't there (doesn't it?) This class shouldn't be loaded if an XThis isn't instantiated in NameSpace.java, should it?
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. |
| public Object |
| Handler | back to summary |
|---|---|
| pack-priv Handler() | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| invokeImpl | back to summary |
|---|---|
| public Object invokeImpl(Object proxy, Method method, Object[] args) throws EvalError | |