Martin Grotzke wrote:
>> We can supply an implementation of an InjectableProvider that reuses
>> the Autowired annotation. That implementation can be equivalent to
>> that of our own @Inject annotation. So for Spring 2.5.x users they do
>> not require a Jersey specific annotation.
> Hmm, I'm somehow confused. Spring 2.5 users already can use the Spring
> annotations and don't have to use our @Inject. Spring does the whole job
> based on the spring 2.5 annotations. Though, I don't want to depend on
> the spring 2.5 annotations but still support spring 2.0.
>
On fields yes, but not for constructors and methods that Jersey is
responsible for invoking. It would only require supporting on 2.5.x.
> You might have a look at AutowiredBySpringSingletonResource and
> AnnotatedSingletonResource for the current usage of spring 2.5
> annotations.
>
> And I'm aware we need some spring example, perhaps I find the time to
> create one this week - if no one else comes first :)
>
Imran offered to work on one as well, perhaps you can work together?
>> I also think we may be able to support better life-cycle integration
>> by enabling the SpringServlet to declare the life-cycle choosing
>> factory mechanism. Thus when using @Component there may be no need to
>> duplicate Jersey life-cycle declarations. I think this may be
>> possible by declaring a default life-cycle when a Jersey life-cycle
>> annotation is absent, looks at the spring annotations on the class,
>> and defers to the appropriate Jersey life-cycle.
> Probably my holiday was too long, again I'm not sure if I understand
> you ;)
>
> Trying to express what I understood/read: You want that jersey(-spring)
> reads the lifecycle from the spring annotations, if no jersey lifecycle
> is declared but a resource class is annotated with @Component?
Yes.
> So the ComponentProvider would tell jersey of what scope a component is,
> if the Scope is not defined by some jersey annotation?
>
I don't think there is a need for that. The property:
"com.sun.jersey.config.property.DefaultResourceProviderClass"
can be set to declare a default ResourceProvider when one is not
declared on a resource class. Thus the SpringServlet can set this
property (if not already set) and the SpringServlet ResourceProvider
implementation can look at the @Component annotation and choose to defer
to the singleton or per-request ResourceProvider implementations.
Paul.
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109