On Nov 22, 2008, at 8:49 PM, Gili wrote:
>
> Why is IoCComponentProviderFactory.getComponentProvider() being
> invoked on
> "internal" Jersey classes such as
> com.sun.jersey.multipart.impl.MultiPartConfigProvider?
>
Cause i have yet to work out a way of filtering out the Jersey
components. I suppose i could do it by package name but that seems
wrong, i think i require a special annotation.
> I thought getComponentProvider() was only supposed to be invoked if
> Jersey
> was 100% certain that the IoC was supposed to inject it, yet I see the
> Spring implementation returning null for this case.
>
> Please clarify the expected behavior of
> IoCComponentProviderFactory.getComponentProvider(). What kind of
> input is it
> supposed to expect? Please document when null is supposed to be
> returned (if
> ever).
>
Null should be returned if the component provider cannot support the
class.
W.r.t. getInjectableInstance the parameter passed in should be from
the ComponentProvider .getInstance method, the return value should be
the underlying component instance that is proxied or the parameter
that is passed in otherwise. This is required if Jersey needs to also
inject and it has to inject on the correct instance (if say IoC
framework proxies). This is a consequence of the support for @*Param
etc being abstract from all IoC frameworks.
Let me document things today or tomorrow... plus modify to use Class<?
>, and hopefully cross fingers it will become a little clearer, at
least i hope much clearer that the previous mechanism in 1.0 (compare
the spring integration code in 1.0 and 1.0.1 and hopefully you will
agree the latter is more encapsulated).
Paul.