On 5/19/2014 3:23 AM, Neven Cvetkovic wrote:
On Sun, May 18, 2014 at 11:26 PM, Neven Cvetkovic <neven.cvetko...@gmail.com
wrote:



...


Chris thanks for the reminder, I will fix the missing page with the
example I wrote, back then.

I thought I have published that already.

I've uploaded code examples and the JmxExample.war:
https://wiki.apache.org/tomcat/Example%20Application%20Exposing%20Internals%20Using%20JMX

So, just deploy JmxExample.war to your Tomcat instance, open up JMX console
through JVisualVM or JConsole, and find the MBean, e.g.
JmxExampleApp:type=Counter

You will see that the internal instance of MyCounter is exposed through
JMX, and you will be able to set the name, initial count, reset the
counter, etc...

The trick was to use @WebListener that registers the MBean instance with
your MBeanServer upon application deployment. Your MBean instance will wrap
around any of your application internals you would with to expose.

Hope that helps!

What kind of performance hit does this "wrapper" cause? A couple of my app's instances take more than 4M transactions per day, up to several hundred per second at peak times. So I can't afford much added work per request.

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to