users@jersey.java.net

Summary/proposal for spring integration

From: Martin Grotzke <martin.grotzke_at_javakaffee.de>
Date: Tue, 25 Mar 2008 08:43:06 +0100

Hi,

as this topic in the meantime is spread over a lot of postings, I just
want to sum up what I would suggest for spring integration.
Unfortunately I cannot speak for other IoC containers like guice, but
perhaps these approaches could be aligned.

- Basically Pauls SpringComponentProvider should be used (with slight
  modifications), so that resource classes could be configured in
  spring and additional spring features like AOP might be used.
  Spring 2.5 features like annotation based DI are fully available with
  this solution.
- Additionally an @Inject annotation should be provided, so that not
  each resource class has to be configured in the applicationContext.xml
  but can get other spring beans injected.
  This annotation should also be available for resource method
  parameters.
- Also provide an @Autowire annotation (with target type) to provide
  autowiring for spring 2.0 users


Open issues:
- The mentioned injection of spring dependencies for method parameters.
  This is needed if an initialized subresource shall be returned from a
  root resource method and features provided by the IoC-container (like
  e.g. AOP) shall be used.
  I'd prefer to use some @SpringBean/_at_Inject annotation for this kind
  of injection as already mentioned above, but AFAICS this is right now
  not possible.

Did I miss any scenario/requirement?

Thanx for your feedback,
cheers,
Martin