-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Neven,
On 4/9/13 10:17 PM, Neven Cvetkovic wrote: > David, > > Here's an example application that has a CounterServlet that counts > hits for example... Here are the classes that I used > > - CounterServlet - just counts number of hits, calls > MyCounter.incrementAndGet() static method - MyCounter - class that > implements the counter (static calls to reset counter, get current > count, etc...) > > - CounterMBean - interface for the MBean I am registering ... all > methods getXxxxxx() will get translated into attribute "xxxxx", > all methods setXxxxxx() will translate into writable attribute > "xxxxxx" - Counter - implements CounterMBean interface (naming is > important here Counter class and CounterMBean interface ... i.e. > Xxxx class and XxxxMBean interface) > > - RegisterMBeansListener - @WebListener that implements > ServletContextListener and registers/unregisters the mbean upon > deployment/undeployment > > That's it.... > > I will attach the WAR file, so you can just deploy it and call the > MBean from jconsole/jvisualvm. I registered: > > JmxExample:type=Counter ... operations are resetCounter() and > resetCounter(int), attributes are currentTimeMilis, currentTime, > currentCount > > If the WAR didn't make it to the mailing list, contact me directly > and I will attach it. > > Have fun with JMX :)) Your WAR file was stripped (or you forgot to attach it). Would you consider posting your example onto the wiki I referenced elsewhere in this thread? I would personally be interested to see how to create my own "JMX beans" for exposure through the JMXProxyServlet. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRZZTbAAoJEBzwKT+lPKRYCr0QAJNkIQBEkLmvVHxc8UEkmeAA 3XL4Qu2HjndAE4f3lVJwu+LxuFdp027TiA6IxZq07H2BJ0pv6QqVMeSAgSake/v4 LqojZD6tq2vWo9995BKyKZxmTjqoNBmkmTNTFXRtybSPTdyrQvDCKVfXx0Sn+p1T NZEkhI/3Ib94xuP86FyOx66IchPeGmgT1UcToFKKkQqkUY1KJYP/mJup4M5vAJE6 IaEajZUXww4DmLeHe77BVxexEVgeF6iZ+b+dppyZ4/9T33MRObRqSbZsbJUGL05b B8maCHXVFyqD7mlmIs9NfwECR3ySI6MF1q5yzjMFSH88UBSYXlFsDsb/jsMWxcBo JlHUz07qR2+6ieHxGpgEwYoqQRO6otcvW1osk4wh1C7FhbOEdtqC0j+oe2ccMGY9 x7YbbRhBFEWGA8YSTCmPYecqA/uidJz8UTltp4hzTAHSkxY1ZqarDWW4zpSNhiAG rQJpCZeUL+iwOs6tlNSaw8KG+sQeusaQi0Ukc5PWV8WcoNZtthFvisa2lxoiQFzJ B8dMXuFGdeJ0hgML4nBv/h4pkC4EGX1rQr+WQOzAAajsE2xHK3RRDQIuiq0KoOvl 2BqM36s8h4CwHYb0qVwtIxCstyefBWjKGhWPdr7QlW2O3wdHvz5+vwD9wSvXWlr6 icOmdBiaI8aIKv3TEXkm =lWOA -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org