Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

bsh
Class XThis  view XThis download XThis.java

java.lang.Object
  extended bybsh.This
      extended bybsh.XThis
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

class XThis
extends This

XThis is a dynamically loaded extension which extends This.java and adds support for the generalized interface proxy mechanism introduced in JDK1.3. XThis allows bsh scripted objects to implement arbitrary interfaces (be arbitrary event listener types). 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).


Nested Class Summary
(package private)  class XThis.Handler
          This is the invocation handler for the dynamic proxy.
 
Field Summary
(package private)  java.util.Hashtable interfaces
          A cache of proxy interface handlers.
(package private)  java.lang.reflect.InvocationHandler invocationHandler
           
 
Fields inherited from class bsh.This
declaringInterpreter, namespace
 
Constructor Summary
(package private) XThis(NameSpace namespace, Interpreter declaringInterp)
           
 
Method Summary
 java.lang.Object getInterface(java.lang.Class clas)
          Get dynamic proxy for interface, caching those it creates.
 java.lang.Object getInterface(java.lang.Class[] ca)
          Get dynamic proxy for interface, caching those it creates.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class bsh.This
bind, getNameSpace, getThis, invokeMethod, invokeMethod, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

interfaces

java.util.Hashtable interfaces
A cache of proxy interface handlers. Currently just one per interface.


invocationHandler

java.lang.reflect.InvocationHandler invocationHandler
Constructor Detail

XThis

XThis(NameSpace namespace,
      Interpreter declaringInterp)
Method Detail

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class This

getInterface

public java.lang.Object getInterface(java.lang.Class clas)
Get dynamic proxy for interface, caching those it creates.

Overrides:
getInterface in class This

getInterface

public java.lang.Object getInterface(java.lang.Class[] ca)
Get dynamic proxy for interface, caching those it creates.

Overrides:
getInterface in class This