[JBoss-user] Method not found in ServiceMBean
Hello, I have written an MBean that extends ServiceMBeanSupport and the corresponding interface that extends ServiceMBean. In the interface I have 2 methods: public ArrayList getRegisteredJndiNames(); public void logRegisteredJndiNames(); They are implemented in the MBean: public ArrayList getRegisteredJndiNames() { return registered; } public void logRegisteredJndiNames() { return log.info(registered); } However, when I look at the jmx-console, I can only see the logRegisteredJndiNames()-method. That is also the only method I can invoke when I call the MBean. What can be wrong with my getRegisteredJndiNames-method. Is it not allowed to return an ArrayList? The returntype seems to be the only difference between the two methods. Bruno --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Method not found in ServiceMBean
Quoting Bruno [EMAIL PROTECTED]: Hello, I have written an MBean that extends ServiceMBeanSupport and the corresponding interface that extends ServiceMBean. In the interface I have 2 methods: public ArrayList getRegisteredJndiNames(); public void logRegisteredJndiNames(); They are implemented in the MBean: public ArrayList getRegisteredJndiNames() { return registered; } public void logRegisteredJndiNames() { return log.info(registered); } However, when I look at the jmx-console, I can only see the logRegisteredJndiNames()-method. That is also the only method I can invoke when I call the MBean. What can be wrong with my getRegisteredJndiNames-method. Is it not allowed to return an ArrayList? The returntype seems to be the only difference between the two methods. I have found the problem. It seems to been forbidden to use get- or set-methods if you want them to show up in a construction like this: MBeanOperationInfo[] opInfo = info.getOperations(); I change the method name to returnRegisteredJndiNames() and it worked... --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Method not found in ServiceMBean
Hi Bruno, your answer to your question is correct. The get and set words are reserved and should not be used at the beginning of a method name that is NOT a get or set method for an attribute. If you have a method with get at the beginning then JMX thinks it is a getter for a readonly attribute (suppose you do not have the corresponding set method). WBR Andreas - Original Message - From: Bruno [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 2:46 PM Subject: Re: [JBoss-user] Method not found in ServiceMBean Quoting Bruno [EMAIL PROTECTED]: Hello, I have written an MBean that extends ServiceMBeanSupport and the corresponding interface that extends ServiceMBean. In the interface I have 2 methods: public ArrayList getRegisteredJndiNames(); public void logRegisteredJndiNames(); They are implemented in the MBean: public ArrayList getRegisteredJndiNames() { return registered; } public void logRegisteredJndiNames() { return log.info(registered); } However, when I look at the jmx-console, I can only see the logRegisteredJndiNames()-method. That is also the only method I can invoke when I call the MBean. What can be wrong with my getRegisteredJndiNames-method. Is it not allowed to return an ArrayList? The returntype seems to be the only difference between the two methods. I have found the problem. It seems to been forbidden to use get- or set-methods if you want them to show up in a construction like this: MBeanOperationInfo[] opInfo = info.getOperations(); I change the method name to returnRegisteredJndiNames() and it worked... --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user __ Gesendet von Yahoo! Mail - http://mail.yahoo.de Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de --- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1refcode1=vs3390 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user