20120618, rgf

org.rexxla.bsf.engines.rexx
Class RexxProxy

java.lang.Object
  extended by org.rexxla.bsf.engines.rexx.RexxProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class RexxProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

This class allows RexxProxy objects to be created from native (JNI) code and will be registered in the BSFRegistry using the String retrievable by getBsfRegistryKey(). It allows ooRexx objects to be addressed by Java, as well as creating any number of java.lang.reflect.Proxy objects from it(cf. newJavaProxyInstance(Object[] interfaces)) which forward any method invocation to the proxied ooRexx object. The class is public, such that any Java program can define variables of type RexxProxy. However, only native code is capable of instantiating this class.

------------------------ Apache Version 2.0 license -------------------------
    Copyright (C) 2009-2010 Rony G. Flatscher

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 ----------------------------------------------------------------------------- 

Version:
1.0.1, 2009-05-03, 2009-06-27, 2009-07-11, 2009-07-31, 2010-04-16
Author:
Rony G. Flatscher (WU/Wirtschaftsuniversität Wien, http://www.wu.ac.at/english)

Field Summary
(package private) static boolean bDebug
          If set, then output for debugging is created.
protected  java.lang.String bsfRegistryKey
          The string value that was used as the key for storing this object in the BSFRegistry.
protected  RexxEngine rexxEngine
          The RexxEngine instance that creates this proxy and which will be used for callbacks.
protected  RexxAndJava rexxInterface
           
protected  java.lang.String rexxInterpreterID
          The string value of the RexxInstance C++ pointer.
protected  java.lang.String rexxObjectID
          The string value of the identity hash value of the ooRexx object, which is used as the key in the proxied ooRexx directory in the JNI code.
protected  java.lang.String rexxUserDataID
          The string value of the identity hash value of the optional "userData" ooRexx object, which - if it is not null - will be submitted as part of the callback directory argument to the Rexx object.
static java.lang.String version
          Version information on this class.
 
Method Summary
 void finalize()
          Finalize method will unregister Rexx object from the JNI registry.
 java.lang.String getBsfRegistryKey()
          Getter method.
static boolean getExtendUsingJanino()
          Getter method for field extendUsingJanino.
 RexxEngine getRexxEngineInstance()
          Getter method.
 java.lang.String getRexxInterpreterID()
          Getter method.
 java.lang.String getRexxObjectID()
          Getter method.
 java.lang.String getRexxUserDataID()
          Getter method.
 java.lang.Object invoke(java.lang.reflect.Method methodObject, java.lang.Object[] args)
          Invokes the given method with the given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Implements the InvocationHandler's method.
 java.lang.Object invoke(java.lang.Object javaObject, java.lang.String methodName, java.lang.String methodDescriptor, java.lang.Object[] args)
          Invokes the given method with the given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object newExtendedProxyInstance(java.lang.Object[] arguments)
          Creates a new class from a supplied abstract class on the fly with all abstract methods being implemented such that they forward their invocations to a RexxProxy.
 java.lang.Object newJavaProxyInstance(java.lang.Object[] interfaces)
          Creates an instance of java.lang.reflect.Proxy using the supplied list of interfaces; will use the RexxProxy as the target object.
protected  java.lang.Boolean proxyEquals(java.lang.Object proxy, java.lang.Object other)
           
protected  java.lang.Integer proxyHashCode(java.lang.Object proxy)
           
protected  java.lang.String proxyToString(java.lang.Object proxy)
           
 java.lang.Object sendMessage(RexxAndJava raj, java.lang.String messageName, java.lang.Object[] args)
          Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage(RexxEngine re, java.lang.String messageName, java.lang.Object[] args)
          Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage(java.lang.String messageName, java.lang.Object[] args)
          Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage0(RexxAndJava raj, java.lang.String messageName)
          Sends the given message using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage0(RexxEngine re, java.lang.String messageName)
          Sends the given message using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage0(java.lang.String messageName)
          Sends the given message using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage1(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1)
          Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage1(RexxEngine re, java.lang.String messageName, java.lang.Object arg1)
          Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage1(java.lang.String messageName, java.lang.Object arg1)
          Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage2(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2)
          Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage2(RexxEngine re, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2)
          Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage2(java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2)
          Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage3(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage3(RexxEngine re, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage3(java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage4(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage4(RexxEngine re, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage4(java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage5(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage5(RexxEngine re, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.
 java.lang.Object sendMessage5(java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.
static void setExtendUsingJanino(boolean b)
          Setter method for field extendUsingJanino.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
Version information on this class.

See Also:
Constant Field Values

bDebug

static boolean bDebug
If set, then output for debugging is created.


rexxInterpreterID

protected java.lang.String rexxInterpreterID
The string value of the RexxInstance C++ pointer. The RexxProxy object can only be deployed via the RexxInstance in which it got created; this assures that the appropriate .local is referencable, and the RexxProxy's package object remains valid w.r.t. to its public routines and classes that may depend on entries in .local as well.


rexxObjectID

protected java.lang.String rexxObjectID
The string value of the identity hash value of the ooRexx object, which is used as the key in the proxied ooRexx directory in the JNI code.


rexxUserDataID

protected java.lang.String rexxUserDataID
The string value of the identity hash value of the optional "userData" ooRexx object, which - if it is not null - will be submitted as part of the callback directory argument to the Rexx object.


bsfRegistryKey

protected java.lang.String bsfRegistryKey
The string value that was used as the key for storing this object in the BSFRegistry.


rexxEngine

protected RexxEngine rexxEngine
The RexxEngine instance that creates this proxy and which will be used for callbacks.


rexxInterface

protected RexxAndJava rexxInterface
Method Detail

setExtendUsingJanino

public static void setExtendUsingJanino(boolean b)
                                 throws org.apache.bsf.BSFException
Setter method for field extendUsingJanino. Controls whether to use the fast ASM solution for extending abstract classes, or the quick (but by no means as fast) Janino-based solution, which allows to proxy Java methods that are defined in superclasses (in this case the supplied method name may be blank-preceded by the superclass name)! If the field extendUsingJanino is false (default), then ASM is used, Janino else.

Throws:
org.apache.bsf.BSFException

getExtendUsingJanino

public static boolean getExtendUsingJanino()
Getter method for field extendUsingJanino.


proxyHashCode

protected java.lang.Integer proxyHashCode(java.lang.Object proxy)

proxyEquals

protected java.lang.Boolean proxyEquals(java.lang.Object proxy,
                                        java.lang.Object other)

proxyToString

protected java.lang.String proxyToString(java.lang.Object proxy)

getRexxInterpreterID

public java.lang.String getRexxInterpreterID()
Getter method.

Returns:
the ooRexx Interpreter ID

getRexxObjectID

public java.lang.String getRexxObjectID()
Getter method.

Returns:
the ooRexx object ID

getRexxUserDataID

public java.lang.String getRexxUserDataID()
Getter method.

Returns:
the ooRexx object ID

getBsfRegistryKey

public java.lang.String getBsfRegistryKey()
Getter method.

Returns:
string value that was used as the key for storing this object in the BSFRegistry

getRexxEngineInstance

public RexxEngine getRexxEngineInstance()
Getter method.

Returns:
the RexxEngine instance that gets used to dispatch methods to ooRexx objects

sendMessage

public java.lang.Object sendMessage(java.lang.String messageName,
                                    java.lang.Object[] args)
                             throws org.apache.bsf.BSFException
Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
args - array of Objects serving as arguments
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage0

public java.lang.Object sendMessage0(java.lang.String messageName)
                              throws org.apache.bsf.BSFException
Sends the given message using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage1

public java.lang.Object sendMessage1(java.lang.String messageName,
                                     java.lang.Object arg1)
                              throws org.apache.bsf.BSFException
Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
arg1 - single argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage2

public java.lang.Object sendMessage2(java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2)
                              throws org.apache.bsf.BSFException
Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage3

public java.lang.Object sendMessage3(java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3)
                              throws org.apache.bsf.BSFException
Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage4

public java.lang.Object sendMessage4(java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4)
                              throws org.apache.bsf.BSFException
Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage5

public java.lang.Object sendMessage5(java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4,
                                     java.lang.Object arg5)
                              throws org.apache.bsf.BSFException
Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
arg5 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage

public java.lang.Object sendMessage(RexxEngine re,
                                    java.lang.String messageName,
                                    java.lang.Object[] args)
                             throws org.apache.bsf.BSFException
Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
args - array of Objects serving as arguments
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage0

public java.lang.Object sendMessage0(RexxEngine re,
                                     java.lang.String messageName)
                              throws org.apache.bsf.BSFException
Sends the given message using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage1

public java.lang.Object sendMessage1(RexxEngine re,
                                     java.lang.String messageName,
                                     java.lang.Object arg1)
                              throws org.apache.bsf.BSFException
Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - single argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage2

public java.lang.Object sendMessage2(RexxEngine re,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2)
                              throws org.apache.bsf.BSFException
Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage3

public java.lang.Object sendMessage3(RexxEngine re,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3)
                              throws org.apache.bsf.BSFException
Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage4

public java.lang.Object sendMessage4(RexxEngine re,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4)
                              throws org.apache.bsf.BSFException
Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage5

public java.lang.Object sendMessage5(RexxEngine re,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4,
                                     java.lang.Object arg5)
                              throws org.apache.bsf.BSFException
Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
re - RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
arg5 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage

public java.lang.Object sendMessage(RexxAndJava raj,
                                    java.lang.String messageName,
                                    java.lang.Object[] args)
                             throws org.apache.bsf.BSFException
Sends the given message with the given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
args - array of Objects serving as arguments
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage0

public java.lang.Object sendMessage0(RexxAndJava raj,
                                     java.lang.String messageName)
                              throws org.apache.bsf.BSFException
Sends the given message using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage1

public java.lang.Object sendMessage1(RexxAndJava raj,
                                     java.lang.String messageName,
                                     java.lang.Object arg1)
                              throws org.apache.bsf.BSFException
Sends the given message with the given argument using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - single argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage2

public java.lang.Object sendMessage2(RexxAndJava raj,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2)
                              throws org.apache.bsf.BSFException
Sends the given message with the two given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage3

public java.lang.Object sendMessage3(RexxAndJava raj,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3)
                              throws org.apache.bsf.BSFException
Sends the given message with the three given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage4

public java.lang.Object sendMessage4(RexxAndJava raj,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4)
                              throws org.apache.bsf.BSFException
Sends the given message with the four given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

sendMessage5

public java.lang.Object sendMessage5(RexxAndJava raj,
                                     java.lang.String messageName,
                                     java.lang.Object arg1,
                                     java.lang.Object arg2,
                                     java.lang.Object arg3,
                                     java.lang.Object arg4,
                                     java.lang.Object arg5)
                              throws org.apache.bsf.BSFException
Sends the given message with the five given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
raj - RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy object
messageName - name of the method to invoke
arg1 - argument
arg2 - argument
arg3 - argument
arg4 - argument
arg5 - argument
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

invoke

public java.lang.Object invoke(java.lang.reflect.Method methodObject,
                               java.lang.Object[] args)
                        throws org.apache.bsf.BSFException
Invokes the given method with the given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
methodObject - for which we invoke a Rexx message
args - array of Objects serving as arguments
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException

invoke

public java.lang.Object invoke(java.lang.Object javaObject,
                               java.lang.String methodName,
                               java.lang.String methodDescriptor,
                               java.lang.Object[] args)
                        throws org.apache.bsf.BSFException
Invokes the given method with the given arguments using a callback to ooRexx using the RexxEngine instance.

Parameters:
javaObject - object that invoked this callback, such that the Rexx side can get access to it and send additional messages to it
methodName - this name is used as the message to be sent to the Rexx object
methodDescriptor - the Java internal representation of the method's arguments and return type, if any
args - array of Objects serving as arguments
Returns:
value that the ooRexx method returns, if any
Throws:
org.apache.bsf.BSFException
Since:
2009-07-11

finalize

public void finalize()
Finalize method will unregister Rexx object from the JNI registry.

Overrides:
finalize in class java.lang.Object

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws org.apache.bsf.BSFException
Implements the InvocationHandler's method.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
org.apache.bsf.BSFException

newJavaProxyInstance

public java.lang.Object newJavaProxyInstance(java.lang.Object[] interfaces)
                                      throws java.lang.IllegalArgumentException
Creates an instance of java.lang.reflect.Proxy using the supplied list of interfaces; will use the RexxProxy as the target object.

Parameters:
interfaces - array of interfaces the java.lang.reflect.Proxy object should implement. Each element may be either a class object, a String which denotes a fully qualified class name which should be loaded instead, or any other object, whose implemented interfaces should be honored.
Returns:
java.lang.reflect.Proxy object which dispatches all messages to this RexxProxy instance, which itself will dispatch (forward) it to ooRexx via a callback
Throws:
java.lang.IllegalArgumentException

newExtendedProxyInstance

public java.lang.Object newExtendedProxyInstance(java.lang.Object[] arguments)
                                          throws java.lang.IllegalArgumentException,
                                                 java.lang.ClassNotFoundException,
                                                 java.lang.NoSuchFieldException,
                                                 java.lang.NoSuchMethodException,
                                                 org.apache.bsf.BSFException,
                                                 java.lang.IllegalAccessException,
                                                 java.lang.reflect.InvocationTargetException
Creates a new class from a supplied abstract class on the fly with all abstract methods being implemented such that they forward their invocations to a RexxProxy. This method then instantiates the extended class supplying itself as the RexxProxy object to be the target of the dispatch. If more than one element gets supplied in the argument array, then they are taken as values for the constructor to invoke.

Parameters:
arguments - array of arguments, element at index 0 must be given and denotes an abstract class whose abstract methods should be implemented; remaining arguments are taken as arguments for the constructor of the extended class
Returns:
object which dispatches all method invocations to this RexxProxy instance, which itself will dispatch (forward) it to ooRexx via a callback
Throws:
java.lang.IllegalArgumentException
java.lang.ClassNotFoundException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
org.apache.bsf.BSFException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

20120618, rgf