users@jersey.java.net

Re: [Jersey] LW HTTP Server and injectable providers

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 13 Jun 2008 11:32:28 +0200

Bertold Kolics wrote:
> Thank you. That helps a lot. It reduces the complexity considerably.
> This is how it looks for me now:
>
> final PackagesResourceConfig config = new PackagesResourceConfig(
> new String[] {"com.example.api.rs" }
> );
> config.getProviderInstances().add(
> new ServerAnnotationInjectableProvider(eidm)
> );
>
> final HttpHandler handler =
> ContainerFactory.createContainer(HttpHandler.class, config);
>
> final HttpServer server =
> HttpServerFactory.create("http://localhost:9998/", handler);
>

Nice.


>
> Bertold
>
> PS: the PackagesResourceConfig constructor javadoc should make it
> obvious that the resource will be looked up in the provided packages *as
> well as* any packages below those specified.
>

I modified the JavaDoc on the class:

   /**
    * A mutable implementation of {_at_link DefaultResourceConfig} that
dynamically
    * searches for root resource classes in a given a set of declared
packages and
    * in all (if any) sub-packages of those declared packages.


Also, i changed the constructor to:

     public PackagesResourceConfig(String... packages)

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109