users@jersey.java.net

Re: [Jersey] Right way to create embedded grizzly with already instantiated Application?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 11 Nov 2008 12:40:16 +0100

On Nov 8, 2008, at 10:18 AM, Paul Sandoz wrote:
>> return GrizzlyServerFactory.create(u, new
>> GrizzlyContainer(wa));
>>
>> }
>>
>> So perhaps you could add
>>
>> GrizzlyServerFactory.create(URI u, ResourceConfig rc,
>> ComponentProvider cp);
>>
>
> Will do.
>

Done.

The recommend approach is as follows:

   URI u = ...
   ResourceConfig rc = ...
   IoCContainerProviderFactory factory = ...
   SelectorThread st = GrizzlyServerFactory.create(u, rc, factory);

Note that it should now be possible to utilize this with the
SpringComponentProviderFactory, which now resides in the package:

   com.sun.jersey.spi.spring.container

as that class is not specific to servlet. So one could do:

   URI u = ...
   ResourceConfig rc = DefaultResourceConfig();
   ConfigurableApplicationContext cac = ...
   IoCContainerProviderFactory factory = new
SpringComponentProviderFactory(rc, cac);
   SelectorThread st = GrizzlyServerFactory.create(u, rc, factory);

Paul.