JMX Instrumentation - Help Please
ravisshankar Sep 26, 2003 4:36 PMI am building a JMXService which acts as a generic agent and uses ModelMBeanInfo object generated through XMLPreferences to register the managed objects in MBEanServer. I have to make a design which is Appserver neutral & should work when JSR 77 is not supported completely/ supports partially in an appserver.
Here, I have couple of question -
Lets say a class named a.b.c.JCAConnection.class need to be managed you have management attributes,operations defined in this and in xml you have metadata defined about this class, my JMXService takes care of Creating / caching the ModelMbeanInfo object and reusing by cloning it for different objects of the same instance.
1) I am Trying an example where a connector application running in a non-managed environment should be manageable. I am not sure whether I am doing in the right way. A better suggestion is much appreciated.
JCAManagedConnectionFactory implements javax.resource.spi.ManagedConnectionFactory-> JCAManagedConnection implements ManagedConnection->1:1->JCAClient ->1:* -> JCAConnection
JCACLient forms a pool of JCAConnection when the ConnectionFactory/JCACLient initializes. Now to register my connectin objects as managed objects in the MBeanServer for stats/operations from any client(thru RMI,HTTP) I register that something like this in JCAClient -
for (int i=0;i<poolsize;i++) {
JmxService.registerMBean("name=connection."+i+",type=Client");
}
}... that is a piece of code . Its something like that.
Now as you can see I am changing the JCACLient to register the connection object with the MBEanServer.
Is there a better design that somebody can suggest without touching the actual code but making the JCA objects managed?
2) When an appserver supports JSR 77 can the JCA implementations become automatically managed though any of the connectors? Here how does the Server intelligently choose the objectname for same objects of same classes(in case of modelmbean)
3) If I representing my mbeans though a JSP and making the JSP query the mbeanserver and do the operation and retrive info/ values about MBean(s), How do I group the mbeans related to the connector object that I mentioned earlier, can I query based on *,type=Client,*..?
Eager to hear from somebody who can say I am wrong.. you can do better this way :-)
Thanks,
Ravi.