-
1. Re: How to lookup a MBean from MBeanServer?
mazz Apr 18, 2005 4:55 PM (in response to chetansanghi)JMX by spec hides the actual reference to the actual object. You cannot get the object referenece via the JMX API (the MBeanServer won't give you access to it).
-
2. Re: How to lookup a MBean from MBeanServer?
chetansanghi Apr 19, 2005 10:58 AM (in response to chetansanghi)Thanks for the reply.
I understand that. But is there another way to do get the object reference of the MBean registered with MBeanServer?
Our purpose is to get the object reference and make a method call on that object. If there is a way to do this please let me know.
--Chetan -
3. Re: How to lookup a MBean from MBeanServer?
starksm64 Apr 19, 2005 11:07 AM (in response to chetansanghi)No, such access defeats one of the primary design goals of jmx.
-
4. Re: How to lookup a MBean from MBeanServer?
mazz Apr 19, 2005 11:09 AM (in response to chetansanghi)Well, your original post implies that you want to somehow find a way to do so via the MBeanServer API. I'm simply saying there is no way. JMX API specifically is designed to avoid allowing what you want (irrespective of the fact that you have the ObjectName - that doesn't matter). You cannot get the object reference from the MBeanServer API.
I suppose you could play some games with the MBean's interface itself. Say, have a method on it like "getSelf()" and have it "return this". You would be forced to make an initial JMX API call to invoke that method via MBeanServer.invoke() but it would return the object reference and you could use that to then make direct calls to it. Kinda defeats the purpose of JMX, but it sounds like that's what you want to do. Also, this will only work if the client is co-located with the MBeanServer - unless you use JBoss/Remoting or some other such thing to "remote" the MBean method calls. -
5. Re: How to lookup a MBean from MBeanServer?
chetansanghi Apr 19, 2005 11:27 AM (in response to chetansanghi)Again thanks for the reply.
So is it possible within same JBoss can a MBean locate another MBean and call method on it?
--Chetan -
6. Re: How to lookup a MBean from MBeanServer?
dimitris Apr 19, 2005 11:35 AM (in response to chetansanghi) -
7. Re: How to lookup a MBean from MBeanServer?
chetansanghi Apr 19, 2005 4:15 PM (in response to chetansanghi)Thanks a lot. That helps and thats what I was looking for.
--Chetan -
8. Re: How to lookup a MBean from MBeanServer?
dimitris Apr 24, 2005 1:56 PM (in response to chetansanghi)The exact case is better explained here, as well:
http://www.jboss.org/wiki/Wiki.jsp?page=HowCanAnMBeanCallAnotherMBean