Try this:
 
MBeanServer myMBeanServer = (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
 
There's a lot of code like that in JBoss itself.
 
Benjamin
-----Original Message-----
From: Brian McSweeney [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2003 16:03
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Basic JMX question

Hi all,
yet again in my quest to write container independent code, I'm stuck. :-)
 
I want to use the Timer service in a container independent manner. The
sheduler services for example isn't container independent :-(.
 
So, the first problem I have here is, I need to get a reference to the MBeanServer
object. Now I know that JMX isn't standard in J2EE until version 1.4 but does the code
 
MBeanServerFactory.findMBeanServer(null);
 
work in JBoss? If so, at least I'll be writing forward compatable code :-) Also,
I think Weblogic uses JMX already too so this might work too.
 
also, is an MBeanServer per jvm? What happens when you cluster?
 
thanks,
Brian
 

Reply via email to