Question

I'm having a little trouble understanding just how to link JMX agent to my TJWS(Tiny java web server)

The web server is instrumented with dynamic MBeans that expose their management interfaces (attributes and operations) at runtime. We identified a set of components as being part of TJWS and we created for each of them a corresponding MBean. ThreadPool or HTTP Session are such types of components. When created, the corresponding MBeans receive a reference to these components through their constructor. When created, the corresponding MBeans receive a reference to these components through their constructor. For each component we chose a set of significant attributes to be monitored

So does this mean that i have to modify the server code so that it creates MBeans on component creation events? Or does it mean something else? :)

I would appriciate if someone could point me in the right direction

Was it helpful?

Solution

I took a look at the link you sent me. I can only read the first 3 pages of it (without paying for it). However, the docs for TJWS do not mention anything about JMX or MBeans, so I assume that the authors of the paper must have implemented the JMX hooks themselves.

Having said that, each of the three models outlined reference a "Managed Application" meaning that the application itself should provide "hooks" to expose the management interfaces. (The following is mostly educated guess-work on my part since the accessible parts of the paper ended just as the description started....)

Daemon Model The MBeanServer and its MBeans are remote to the managed application, so the application needs to provide a means of remotely invoking the exposed management functions. This could be RMI, REST, WebServices etc.

Component Model Same as the daemon model but the exposed functions can be invoked locally and do not need remoting.

Driver Model Same as the Component Model.

To be honest, unless this is an academic exercise, I would stick with a simplified component model where the existing TJWS components are instrumented and implement MBean interfaces. For example, your ThreadPools would implement MBean interfaces and provide JMX attributes such as MaxThreadCount and ActiveThreadCount. Then these MBeans should be registered in the local VM's platform MBeanServer. (Assuming Java 1.5+)

The remoting and federation of MBeanServers will be taken care of in that remoting is built in to the JVM (RMI, IIOP, WebServices and REST are all available) and federation can be implemented using OpenDMK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top