|
20091031, rgf | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rexxla.bsf.engines.rexx.RexxProxy
public class RexxProxy
This class allows RexxProxy objects to be created from native (JNI) code and will be
registered in the BSFRegistry using the String retrievable by #getRegistryKeyValue()
.
It allows ooRexx objects to be addressed by Java, as well as creating any number
of java.lang.reflect.Proxy objects from it(cf. Object 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 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. -----------------------------------------------------------------------------
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
static boolean bDebug
protected java.lang.String rexxInterpreterID
protected java.lang.String rexxObjectID
protected java.lang.String rexxUserDataID
protected java.lang.String bsfRegistryKey
protected RexxEngine rexxEngine
protected RexxAndJava rexxInterface
Method Detail |
---|
protected java.lang.Integer proxyHashCode(java.lang.Object proxy)
protected java.lang.Boolean proxyEquals(java.lang.Object proxy, java.lang.Object other)
protected java.lang.String proxyToString(java.lang.Object proxy)
public java.lang.String getRexxInterpreterID()
public java.lang.String getRexxObjectID()
public java.lang.String getRexxUserDataID()
public java.lang.String getBsfRegistryKey()
public RexxEngine getRexxEngineInstance()
public java.lang.Object sendMessage(java.lang.String messageName, java.lang.Object[] args) throws org.apache.bsf.BSFException
messageName
- name of the method to invokeargs
- array of Objects serving as arguments
org.apache.bsf.BSFException
public java.lang.Object sendMessage0(java.lang.String messageName) throws org.apache.bsf.BSFException
messageName
- name of the method to invoke
org.apache.bsf.BSFException
public java.lang.Object sendMessage1(java.lang.String messageName, java.lang.Object arg1) throws org.apache.bsf.BSFException
messageName
- name of the method to invokearg1
- single argument
org.apache.bsf.BSFException
public java.lang.Object sendMessage2(java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2) throws org.apache.bsf.BSFException
messageName
- name of the method to invokearg1
- argumentarg2
- argument
org.apache.bsf.BSFException
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
messageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argument
org.apache.bsf.BSFException
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
messageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argument
org.apache.bsf.BSFException
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
messageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argumentarg5
- argument
org.apache.bsf.BSFException
public java.lang.Object sendMessage(RexxEngine re, java.lang.String messageName, java.lang.Object[] args) throws org.apache.bsf.BSFException
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokeargs
- array of Objects serving as arguments
org.apache.bsf.BSFException
public java.lang.Object sendMessage0(RexxEngine re, java.lang.String messageName) throws org.apache.bsf.BSFException
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invoke
org.apache.bsf.BSFException
public java.lang.Object sendMessage1(RexxEngine re, java.lang.String messageName, java.lang.Object arg1) throws org.apache.bsf.BSFException
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- single argument
org.apache.bsf.BSFException
public java.lang.Object sendMessage2(RexxEngine re, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2) throws org.apache.bsf.BSFException
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argument
org.apache.bsf.BSFException
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
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argument
org.apache.bsf.BSFException
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
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argument
org.apache.bsf.BSFException
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
re
- RexxEngine object to use for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argumentarg5
- argument
org.apache.bsf.BSFException
public java.lang.Object sendMessage(RexxAndJava raj, java.lang.String messageName, java.lang.Object[] args) throws org.apache.bsf.BSFException
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokeargs
- array of Objects serving as arguments
org.apache.bsf.BSFException
public java.lang.Object sendMessage0(RexxAndJava raj, java.lang.String messageName) throws org.apache.bsf.BSFException
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invoke
org.apache.bsf.BSFException
public java.lang.Object sendMessage1(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1) throws org.apache.bsf.BSFException
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- single argument
org.apache.bsf.BSFException
public java.lang.Object sendMessage2(RexxAndJava raj, java.lang.String messageName, java.lang.Object arg1, java.lang.Object arg2) throws org.apache.bsf.BSFException
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argument
org.apache.bsf.BSFException
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
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argument
org.apache.bsf.BSFException
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
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argument
org.apache.bsf.BSFException
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
raj
- RexxAndJava object which RexxEngine will be used for the call, if null, using RexxEngine object that created this RexxProxy objectmessageName
- name of the method to invokearg1
- argumentarg2
- argumentarg3
- argumentarg4
- argumentarg5
- argument
org.apache.bsf.BSFException
public java.lang.Object invoke(java.lang.reflect.Method methodObject, java.lang.Object[] args) throws org.apache.bsf.BSFException
methodObject
- for which we invoke a Rexx messageargs
- array of Objects serving as arguments
org.apache.bsf.BSFException
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
javaObject
- object that invoked this callback, such that the Rexx side can get access to it and send additional messages to itmethodName
- this name is used as the message to be sent to the Rexx objectmethodDescriptor
- the Java internal representation of the method's arguments and
return type, if anyargs
- array of Objects serving as arguments
org.apache.bsf.BSFException
public void finalize()
finalize
in class java.lang.Object
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws org.apache.bsf.BSFException
InvocationHandler
's method.
invoke
in interface java.lang.reflect.InvocationHandler
org.apache.bsf.BSFException
public java.lang.Object newJavaProxyInstance(java.lang.Object[] interfaces) throws java.lang.IllegalArgumentException
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.
java.lang.IllegalArgumentException
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
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
java.lang.IllegalArgumentException
java.lang.ClassNotFoundException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
org.apache.bsf.BSFException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
|
20091031, rgf | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |