Sometime you will find yourself in the situation of wanting to monitor your application, but no monitoring capability is given. So you will have to write your own Java MBean that will expose information of your JBoss application to a JMX Client.
Main post:
Examples: jboss-eap-4.3_CP08/jboss-as/docs/examples/jmx/logging-monitor
From the JBoss SVN you can get sample MBean classes:
/svn_jboss_org/trunk/varia/src/main/java/org/jboss/jmx/examples/configuration/
Have your MBean interface extend the
org.jboss.system.Service and
org.jboss.system.ServiceMBean
interface.
jboss-eap-4.3_CP08/jboss-as/server/all/deploy/management/console-mgr.sar/web-console.war/applet.jar
Add the classes
You can see two MBean that are almost the same (up to the fact that one extends the org.jboss.system.ServiceMBean class)
1.
Attributes: JndiName
Operations: start / stop
2.
Extents the class org.jboss.system.ServiceMBean -- you can see that this class gives you out of the
Attributes: Name / JndiName / StateString / State
Operations: destroy / start / stop /create / jbossInternalLifecycle
Notificaitons
Explanation on standard Java MBean like RuntimeMXBean, ThreadMXBean, MemoryPoolMXBean, ... can be found here: http://download.oracle.com/javase/1.5.0/docs/guide/management/overview.html
Jacorb to be found in:
eap43CP08/jboss-as/server/all/lib/jacorb.jar
org.jacorb.util.threadpool.ThreadPool.class (here we have to get the information on the thread pool counter.
In class ThreadPool within method createNewThread() the following line:
localThread.setName(this.namePrefix + this.threadCount++);
Jacorb example:
http://www.jpackage.org/browser/rpm.php?jppversion=6.0&id=7709
Set up environment:
jboss-log4j.xml
No comments:
Post a Comment