----- Original Message -----
From: "ubekhet" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Friday, May 16, 2008 10:33 PM
Subject: Re: JMX MBean
Liang,
When I read this, I think, "Damn, the guy is rebuilding Tomcat" ;)
Are you?
Are you trying to make a new version of TC... sounds like you into the
source there.
If so thats not a problem, but then you should be in the dev, group, there
you can talk to the guys that actually wrote the Mbena modules.
If not and its a bean in your servlet that you want to use.
Then this article is the only one I've ever seen on the subject
http://oss.wxnet.org/mbeans.html
Essentially there is a bean Registry inside tomcat... and the idea is to get
your bean into that registry... then TC will treat it like its own internal
beans, and then Jconsole will see it.
So... it seems you stick your bean in TC libs, you do a little XML stuff so
the TC picks it up, and then you use a listener to start the bean.
Then your Servlet will just use that bean.
Then mbeans are actually quite complex, and getting the interfaces right is
not so easy, but luckily Netbeans, and probably eclipse (not sure) has a
plugin that automates the testing mbeans in your code... so together you on
your way... hopefully.
That side of it will help you get the Mbean right and figure out how to get
a chart going in Jconsole etc.
It doesnt seem to be a very popular topic, and I think thats because most
guys (like me) think, JMX is cool, but TC is a great big powerful Web
Server... and in the end... we (I) just end up using a web page to change
some custom servlet configuration, or display status.
I still havnt found a reason to really use JMX in my own servlets...
"because its TC".
In an accounting app or something like that, I think JMX would be great.
Anyway... thats why I think documentation is a little thin in this area.
If you are into the source... then this whole registration thing will be
done differently... but for that, you'll have to ask the guy the wrote it.
ie if you playing with the TC source in org/apache/catalina/mbeans
For that you have to be younger than 20... else you may run out of time ;)
Hi Caldarale,
Yes, I use the current version of Tomcat. Thanks for your link, but I want
to know how to implement MBean, because according the web you gave, I have
to add my MBean to the mbeans-descriptor.xml and also the folder where is
contained.
For example, if I want to implement the HelloWorld in
java/org/apache/catalina/mbeans, first of all I have to add to
mbeans-descriptor.xml in java/org/apache/catalina and then also in
java/org/apache/catalina/mbeans.
On the other hand, I've implemented HelloWorld.java in
java/org/apache/catalina/deploy and HelloWorldMBean as interface in
java/org/apache/catalina/mbeans. This implementation is the correct way?
Other way in the same java/org/apache/catalina/deploy directory contain
another mbeans-descriptor.xml file
Can you say me, if I am right?
Thanks a lots!!!
Caldarale, Charles R wrote:
-----Original Message-----
From: Liang Xiao Zhu [mailto:[EMAIL PROTECTED] Subject: JMX
MBean
I am searching how to implement a MBean for a class that I implemented,
which add some new funcionality to Tomcat.
Don't suppose you'd care to tell us what version of Tomcat you're using?
If it's the current level, have you followed these instructions?
http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html
- Chuck
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]