cancel
Showing results for 
Search instead for 
Did you mean: 

Extending JMX

adrianblakey
Champ in-the-making
Champ in-the-making
We are running the Enterprise version. We have used the mvn archetypes to develop custom actions. We'd like the actions to be configurable from JMX - in effect extending the list of JMX variables that are delivered with the product. Is this possible? if so do you have an example?
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Yes it is possible however while some stuff does seem to work "like magic" some stuff also needs to be coded.  

Need more specifics of your requirement to be able to comment further.    You may also like to study the existing enterprise JMX code to understand how to extend it.

adrianblakey
Champ in-the-making
Champ in-the-making
Specifically - I'd like to control how much logging a custom action performed so that say if it got into production and we had errors in it I could turn its loglevel to DEBUG. I'd also like to inject runtime dependencies for example we have some usually fixed URL's to which a custom action might connect, however let's say for some reason we need to swap them to another value because they changed. Really just using it to interact with property settings in much the same way as it works hand in glove with Alf. property files.

mrogers
Star Contributor
Star Contributor
I think you can already control the loggers at runtime through JMX.   I've done it once 8-)

Changing a property value is more complicated and you will need to add code unless your custom action uses a subsystem for its configuration.    In outline you need an interface to expose to JMX.   An adapter that implements that interface and does whatever needs to be done.  And something to register the interface with JMX.   There are abstract beans that do the registration for you.