users@grizzly.java.net

Re: Automatically publishing all JAX-WS annotated web services found on classpath when using standalone grizzly

From: Sebastien Dionne <survivant00_at_gmail.com>
Date: Thu, 23 Dec 2010 12:52:58 -0500

Shouldn't be a problem. I need a usecase with a sample if what you want to
do
On Dec 23, 2010 10:51 AM, "Oleksiy Stashok" <oleksiy.stashok_at_oracle.com>
wrote:
> Hi Sebastien,
>
> glad to hear you! :)
>> Just for info. Grizzly Deployer do something like that for servlet
>> annotations in classpath. But it's for web.xml stuff.
>>
> Interesting, is it possible to use that code to declare custom
> annotation and the annotation processing logic?
>
> WBR,
> Alexey.
>
>> On Dec 22, 2010 1:13 PM, "Leo Romanoff" <romixlev_at_yahoo.com> wrote:
>> >
>> > Hi Alexey,
>> >
>> > Thanks for your reply.
>> >
>> >> IMO the annotation usecase needs deeper investigation, so I'm not
>> sure
>> >> JSR109 type of deployment will work as it is.
>> >> Though, as you have mentioned the JAX-WS servlet type of deployment
>> >> should work, but for sure you need to provide web services
>> descriptor
>> >> files.
>> >
>> > Just to make it clear. I'd like to avoid using complete WAR/EAR
>> files with
>> > all the descriptor files and the like. This would probably require
>> the whole
>> > J2EE container to be supported properly.
>> >
>> > I'd really like to be able to put all my annotated JAX-WS services
>> e.g into
>> > JARs without any further archives and descriptors around them and
>> let the
>> > JAX-WS runtime and grizzly components (e.g. grizzly-servlet-
>> webserver or
>> > something else) find out these JAX-WS-annotated classes inside
>> those JARs
>> > and publish them. This is exactly how Jersey works on top of
>> Grizzly. You
>> > just tell it where to look for your annotated JAX-RS classes and
>> it does the
>> > REST ;-)
>> >
>> > Thanks,
>> > -Leo
>> >
>> >
>> > Oleksiy Stashok-2 wrote:
>> >>
>> >> Hi Leo,
>> >>
>> >> IMO the annotation usecase needs deeper investigation, so I'm not
>> sure
>> >> JSR109 type of deployment will work as it is.
>> >> Though, as you have mentioned the JAX-WS servlet type of deployment
>> >> should work, but for sure you need to provide web services
>> descriptor
>> >> files.
>> >>
>> >> Thanks.
>> >>
>> >> WBR,
>> >> Alexey.
>> >>
>> >>> I'm wondering if it is somehow possible to tell jax-ws to publish
>> >>> all the
>> >>> annotated JAX-WS services found on the (specified) classpath. So
>> >>> far, I've seen
>> >>> this implemented only for J2EE apps, where during JAR/WAR
>> >>> deployments, the
>> >>> application server would scan the archives, find all annotated
>> >>> services and
>> >>> publish them.
>> >>>
>> >>> But I'm very interested in doing that when using JAX-WS together
>> with
>> >>> grizzly-servlet-webserver and grizzly SPI for JAX-WS.
>> >>>
>> >>> Jersey's JAX-RS implementation when used with grizzly-servlet-
>> >>> webserver and
>> >>> jersey-server can easily find and provision all annotated JAX-RS
>> >>> services, e.g.
>> >>>
>> >>> GrizzlyWebServer server;
>> >>> server = new GrizzlyWebServer(port);
>> >>>
>> >>> ServletAdapter jersey = new ServletAdapter();
>> >>> jersey.setServletInstance(new ServletContainer());
>> >>>
>> >>> // Tell jersey where to find REST resources
>> >>> // It would scan all classes on this classpath and
>> >>> find all
>> >>> annotated services
>> >>>
>> >>>
>> jersey.addInitParameter(ClasspathResourceConfig.PROPERTY_CLASSPATH,
>> >>> "my.jar");
>> >>>
>> >>> jersey.setServletPath("/path");
>> >>>
>> >>> // Tell grizzly to serve our REST service
>> >>> server.addGrizzlyAdapter(jersey, new String[] { "/
>> >>> path" });
>> >>> try {
>> >>> server.start();
>> >>> } catch (IOException e) {
>> >>> e.printStackTrace();
>> >>> }
>> >>>
>> >>> So, would it be possible to do something similar using JAX-WS
>> (with
>> >>> Grizzly
>> >>> support) as well?
>> >>>
>> >>> Thanks,
>> >>> Leo
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
http://old.nabble.com/Automatically-publishing-all-JAX-WS-annotated-web-services-found-on-classpath-when-using-standalone-grizzly-tp30513769p30516249.html
>> > Sent from the Grizzly - Users mailing list archive at Nabble.com.
>> >
>