users@grizzly.java.net

Re: How to enable JMX with Jersey/Grizzly

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 26 Jun 2009 09:01:12 +0200

On Jun 26, 2009, at 3:59 AM, testn wrote:

>
> Hmm... sounds like using GrizzlyWebContainerFactory causing too much
> trouble.

Yes, this is a helper class, recommend for your case you do not use it.

You can use the Grizzly Web support + ServletAdapter, i cannot recall
off the top of my head, which provides similar high-level
functionality that one can use with Jersey.

Or copy the code from GrizzlyWebContainerFactory:

http://fisheye4.atlassian.com/browse/jersey/trunk/jersey/jersey-server/src/main/java/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.java?r=1471

Paul.

>
> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>