users@jersey.java.net

Re: [Jersey] Context Notifier reload no longer works on jersey 1.4

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Thu, 07 Oct 2010 16:16:53 +0200

  FYI: filled new issue:
https://jersey.dev.java.net/issues/show_bug.cgi?id=590


On 10/5/10 12:59 PM, Paul Sandoz wrote:
>
> On Sep 24, 2010, at 2:22 PM, Guilhem wrote:
>
>> hi paul,
>> your piece of code give me an idea. I could have the same
>> functionality that before by doing :
>>
>> @Override
>> protected void configure(final ServletConfig sc, ResourceConfig
>> rc, WebApplication wa) {
>> super.configure(sc, rc, wa);
>>
>> /* I remove this piece of code
>> if (!configured) {
>> final ContainerNotifierImpl cnImpl = new
>> ContainerNotifierImpl();
>>
>> rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_NOTIFIER,
>> cnImpl);
>> rc.getSingletons().add(new
>> ContextInjectableProvider<ContainerNotifierImpl>(ContainerNotifierImpl.class,
>> cnImpl));
>> configured = true;
>> }*/
>> }
>>
>> @Override
>> protected void initiate(ResourceConfig rc, WebApplication wa) {
>> // and put it here
>> final ContainerNotifierImpl cnImpl = new ContainerNotifierImpl();
>>
>> rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_NOTIFIER,
>> cnImpl);
>> rc.getSingletons().add(new
>> ContextInjectableProvider<ContainerNotifierImpl>(ContainerNotifierImpl.class,
>> cnImpl));
>> wa.initiate(rc);
>>
>> }
>>
>> this is supposed to works right?
>>
>
> Until we fix this why not just override the initiate method to do this:
>
> protected void initiate(ResourceConfig rc, WebApplication wa) {
> wa.initiate(rc);
> }
>
> and leave your original code in place?
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>