Thread: [tcljava-user] Java Keyword - "this".
Brought to you by:
mdejong
From: <PFi...@hb...> - 2005-10-28 03:22:05
|
How do I code the java keyword "this" in JACL? JAVA Code. adminClient.addNotificationListener(nodeAgent, this, null, null); JACL Code. $AdminClientI addNotificationListener $nodeAgent this $nullI $nullI error in procedure java::call: "this" is not an object handle of class "javax.management.NotificationListener" I use java::null to get a handle to the null Java reference. Is there something similar for the "this" keyword or a work around? Regards. Patrick. =================================================== HBF Health Funds Inc. a registered organisation under the National Health Act HBF Insurance Pty Ltd ACN 009 268 277 This email is a confidential communication intended only for the named Addressee(s). If you are not that person any disclosure, copying, distribution or use of this email or the information in it is prohibited. Please notify us immediately by telephone, (+61) 08 9265 6111 or return email and delete this email. The views in this email may be personal to the author and not those of HBF. |
From: Tom P. <tpo...@ny...> - 2005-10-28 15:26:06
|
On Fri, Oct 28, 2005 at 11:22:52AM +0800, PFi...@hb... wrote: > How do I code the java keyword "this" in JACL? > > JAVA Code. > > adminClient.addNotificationListener(nodeAgent, this, null, null); > > JACL Code. > > $AdminClientI addNotificationListener $nodeAgent this $nullI $nullI > Wouldn't you just just $AdminClientI, as in: $AdminClientI addNotificationListener $nodeAgent $AdminClientI $nullI $null -- Tom Poindexter tpo...@ny... http://www.nyx.net/~tpoindex/ |
From: <PFi...@hb...> - 2005-10-31 03:50:28
|
Tried that but got: "error in procedure java::call: expected object of type javax.management.Notifica tionListener but got "java0x3" (com.ibm.websphere.management.AdminClient)" AdminClient is created using AdminClientFactory "set AdminClientI [ java::call AdminClientFactory createAdminClient $PropertiesI ]" The notification listener is created using "AdminClientI addNotificationListener $nodeAgentBean this $nullI $nullI" The addNotificationListener method takes a NotificationListener object argument which is denoted by the "this" keyword in the statement above. I suppose this acts recursively. public void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws javax.management.InstanceNotFoundException, ConnectorException NotificationListener is an interface with no static methods so I cannot create it outside of an addNotificationListener method. If you are interested the javadoc for the IBM WebSphere Application ServerTM, Release 5 API Specification is at: http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/index.html The javadoc for NotificationListener is: javax.management Interface NotificationListener Method Summary void handleNotification(Notification notification, java.lang.Object handback) Invoked when a JMX notification occurs. Method Detail handleNotification public void handleNotification(Notification notification, java.lang.Object handback) Invoked when a JMX notification occurs. The implementation of this method should return as soon as possible, to avoid blocking its notification broadcaster. Parameters: notification - The notification. handback - An opaque object which helps the listener to associate information regarding the MBean emitter. This object is passed to the MBean during the addListener call and resent, without modification, to the listener. The MBean object should not use or modify the object. Regards. Patrick. =================================================== HBF Health Funds Inc. a registered organisation under the National Health Act HBF Insurance Pty Ltd ACN 009 268 277 This email is a confidential communication intended only for the named Addressee(s). If you are not that person any disclosure, copying, distribution or use of this email or the information in it is prohibited. Please notify us immediately by telephone, (+61) 08 9265 6111 or return email and delete this email. The views in this email may be personal to the author and not those of HBF. |
From: D.J.Hagberg <dha...@mi...> - 2005-10-28 03:44:32
|
Patrick, I'm not sure if I'm permitted to reply to your message, based on the nasty notice at the bottom of your email but here goes -- Well, there is no straight equivalent, since the Jacl code isn't really a Java object. You would need to pass in some /other/ Java object that implements the required interface -- in your case an instance of NotificationListener. I don't believe that Jacl has the capabilities that some other JVM scripting languages (Rhino, Jython, and Groovy come to mind) for the script to implement a particular interface. Perhaps I stand to be corrected? You may be able to extend the interpreter to provide a facility like this using JDK 1.3+'s dynamic proxy support, unless someone's done this already. -=- D. J. On Oct 27, 2005, at 9:22 PM, <PFi...@hb...> wrote: > How do I code the java keyword "this" in JACL? > > JAVA Code. > > adminClient.addNotificationListener(nodeAgent, this, null, null); > > JACL Code. > > $AdminClientI addNotificationListener $nodeAgent this $nullI $nullI > > error in procedure java::call: > "this" is not an object handle of class > "javax.management.NotificationListener" > > I use java::null to get a handle to the null Java reference. Is there > something similar for the "this" keyword or a work around? > > Regards. > > Patrick. > > =================================================== > HBF Health Funds Inc. a registered organisation under the National > Health Act > HBF Insurance Pty Ltd ACN 009 268 277 > This email is a confidential communication intended only for the named > Addressee(s). > If you are not that person any disclosure, copying, distribution or > use of this email > or the information in it is prohibited. Please notify us immediately by > telephone, (+61) 08 9265 6111 or return email and delete this email. > The views in this email may be personal to the author and not those of > HBF. |