users@grizzly.java.net

Re: How to enable JMX with Jersey/Grizzly

From: testn <test1_at_doramail.com>
Date: Thu, 25 Jun 2009 18:59:23 -0700 (PDT)

Hmm... sounds like using GrizzlyWebContainerFactory causing too much trouble.
It turns out that it calls .listen() immediately therefore, I don't have a
chance to set jmxManagement.



testn wrote:
>
> Hi,
>
> I tried to enable JMX when running Jersey under Grizzly but it doesn't
> quite work. It seems that Management anonymous class is not getting any
> callback. Any idea?
>
> thread = com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory
> .create(uri, SpringServletContainer.class, initParams);
> thread.setManagement(new Management() {
>
> public void registerComponent(Object bean, ObjectName oname,
> String type) throws Exception {
> Registry.getRegistry("jmx", "jmx").registerComponent(bean,
> oname, type);
> }
>
> public void unregisterComponent(ObjectName oname) throws Exception {
> Registry.getRegistry("jmx", "jmx").unregisterComponent(oname);
> }
> });
> thread.setCompression("deflate");
> thread.start();
>

-- 
View this message in context: http://www.nabble.com/How-to-enable-JMX-with-Jersey-Grizzly-tp24213708p24213815.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.