Another java trivia:
1. Add jmx.jar and commons-modeler.jar in your CLASSPATH
2. Insert at the top of the file:
import org.apache.commons.modeler.Registry;
3. Add in constructor ( or somewhere ):
Registry reg=Registry.getRegistry();
reg.registerComponent( this, DOMAIN, TYPE, OBJECTNAME );
The type doesn't matter too much unless you have the optional mbeans-descriptors.xml in the same package. Start the JMX console ( that's a bit more complicated - another 3 steps ) and enjoy viewing/setting attributes at runtime.
Why would you want to do that ? For fun and to monitor what's happening inside your app, or control it "life".
A HEAD build of modeler is required ( 1.0 won't work ).
Technical stuff
Friday, January 24, 2003
JMX-enable a bean in 3 easy steps
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2003
(44)
-
▼
January
(23)
- Authorization and security
- Kde3.1 on RedHat 8
- Java security
- Tahoe
- JMX-enable a bean in 3 easy steps
- TLD listeners and context initialization
- int[] versus Integer or IntHolder
- Weblog and wiki
- Load balancing in jk
- Configurable TagPool in 50
- It's already done - nntp/rss gateway
- Using context params or JNDI for configuration
- SingleThreadedModel may be usefull
- Precompile the JSPs
- Classloader fun with JDK1.4
- More JMX in tomcat5
- Extension points in tomcat5
- UserDatabase needs changes
- Ser2xml
- Starting to "blog"
- Ant: delayed task creation
- import in ant
- JMX support in ThreadPool
-
▼
January
(23)
No comments:
Post a Comment