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: Fri, 07 Nov 2008 19:46:23 +0100

On Nov 7, 2008, at 6:52 PM, American Jeff wrote:

> After a lot of poking around I've come up with this function to create
> an embedded Grizzly instance from an already instantiated Application
> object:
>
> protected SelectorThread createGrizzly(URI u, Application app)
> throws IllegalArgumentException, IOException {
>
> return GrizzlyServerFactory.create(u,
> RuntimeDelegate.getInstance().createEndpoint(app, Adapter.class));
>
> }
>
>
> I'm wondering if this is really the right way.

Yes. But how about i add methods to GrizzlyServerFactory to do this:

   GrizzlyServerFactory.create(String uri, ResourceConfig rc);

   GrizzlyServerFactory.create(URI, u, ResourceConfig rc);

(and add the same for the LW HTTP server) in 1.0.1 ?


> My main concern is that
> I'm going to have to figure this all out again in the next rev of
> Jersey. The part that gives me pause is the call to createEnpoint with
> Adapter.class.

The use of RuntimeDelegate.getInstance().createEndpoint() will not
change, nor will GrizzlyServerFactory.

Paul.

> But it seems to be the only way for me to achieve this
> end without doing a copy-paste-modify of
> GrizzlyWebContainerFactory.create
>



>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>