Hi LightBulb,

If you asking this, because of Robert Bowen question "Programmatically stop/start context" from WebApp, I also wait with anticipation for the JMX solution. I have a feeling that making a light weight JMX client that lives in a servlet, may not be that easy, we'll see what he comes up with.

Its very quiet, so I'll volunteer an explanation, and get shot down in flames ;) but it gets the conversation going , normal procedure ;) You got this Servlet Management Interface to Tomcat.... and it calls into its OWN engine, and does stuff (like deploy start/stop) as well as provide other servlets like a JMX Proxy, that grab that JMX call, feeds in down to the MBean Server, and returns the XML to whatever made the call.

BUT, there is another important management interface, that is not really talked about much, and its very to use and very powerful, and thats what you seeing in that article. http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

If you start to think about how an IDE works its magic, and starts and stops, and deploys and undeploys.... you may at first think its talking to the manager servlets directly.... its not. In Tomcat there is another client Task engine, which acts as a client to the manager servlet.
Netbeans in fact uses that, through ant.
So in fact what is happening, is it calls into the CLIENT TASKS, they call the Manager Servlets (which can be located on any machine), and the job gets done.

So for example if Robert Bowen emulated the management servlet, in his own servlet, he will ONLY be able to control the tomcat his servlet is in, and will end up also having to make these CLIENT TASKS.

Now because I think its not that easy to make JMX clients, one of these CLIENT TASKS, is in fact a JMX client. So.... you or and IDE via ant, calls the JMX CLIENT TASK, the client task then does the JMX stuff for you and calls the SERVLET MANAGER... it does its thing, returns the REMOTE tomcat answer to the LOCAL tomcat, and the ant script gives it back to you.

Now if you look at the little bit of code I gave Robert to start a server.... all I'm actually doing is bypassing ant, and calling the ant task directly, because who wants to use ant from a web-app, and note that I'm hitting the CLIENT TASKS, and that means it can control any server on any machine, not just my own.

The guys rekon its kludgy, and they right because calling into Tomcat has versioning issues, but I think its pretty safe, because if they changed that interface, IDE control of tomcat would break... Netbeans wouldnt work with Tomcat. How did I get onto this.... just by looking at the ant script NB generates for tomcat. This interface you looking at, I think is more geared towards IDE control, than pure JMX, else I think there would be more emphasis on the client side, there isnt, because its in tomcat already.

.... hope that helps



----- Original Message ----- From: "lightbulb432" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Monday, June 25, 2007 9:04 PM
Subject: Use JMX to manage applications



How, from a web application deployed to Tomcat, can you customize the
behavior of your web application based on attributes specified in an MBean? The link http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html talks a lot
about Ant tasks, but that's not really what I'm looking to do.

How can you get programmatic access to MBeans? And how do you deploy MBeans
to Tomcat?

I'm pretty confused here...hopefully someone can clarify. Thanks.
--
View this message in context: http://www.nabble.com/Use-JMX-to-manage-applications-tf3978363.html#a11293522
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to