[jboss-user] [Microcontainer] - Does the Microcontainer register MBeans that it deploys with
Gary Marsh
do-not-reply at jboss.com
Fri Dec 12 17:14:31 EST 2008
I am using the DZone_1_0 demo's JMXMain.java, Main.java, JMXKernel.java, JBossJMXKernel.java along with HDScanner.java and MainDeployerHelper.java to deploy my own MBeans. I am using aop injection to pass the JMXKernel's serviceController in as a parameter to the constructor of my DataManagementServer class (DMServer) a POJO. The MBeans are deployed first and then the DMServer is deployed last. When I access the MBeanServer that is contained in the serviceController I am unable to see any reference to my MBeans when I execute a piece of code like :
public DataManagementServer(ServiceController sController ) {
|
| mbeanServer =sController.getMBeanServer( );
| Set<ObjectInstance> mBeanObjects = mbeanServer.queryMBeans( null, null );
| Set<ObjectName> mbObjectNames = mbeanServer.queryNames( null, null );
|
| String className = "";
| ObjectName objName = null;
|
| for( ObjectInstance objInst : mBeanObjects ){
|
| associatedType = "";
| className = objInst.getClass( ).getName( );
|
| if( className.contains( "MonitorMgmt" ))
| continue;
|
| if( className.contains("DirMonitor") ){
| objName = objInst.getObjectName( );
|
| associatedType = (String) mbeanServer.invoke( objName, "getAssociateType", null, null );
|
| // do some work
| }
| }
| }
|
The problem I am running into is, although my MBeans deploy correctly they aren't registered with the MBeanServer. Is this the correct behavior? I thought the MBeans were suppose to be deployed and registered with the MBeanServer. Would this be something that happens in the lower levels of the Microcontainer or should I modify the Demo code to make this happen?
Regards,
GMarsh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4196327#4196327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4196327
More information about the jboss-user
mailing list