Paul Sandoz (via Nabble) 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.
[snip]
> Null should be returned if the component provider cannot support the
> class.
When you finally implement this, wouldn't this mean the component
provider must never return null? My point is that if you're going to
allow null anyway then it might not make a difference whether you pass
it Jersey-specific classes or not because the ComponentProvider can just
return null (filtering them beforehand might improve performance slightly).
> 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.
Paul, I think this method needs to return a Class, not an Object. CGLIB
proxies are simply subclasses of the underlying class which means that I
have an object of type Foo$$EnhancerByGuice$$45c70c66
whose superclass is Foo which you want. There is no way for me to give
you an unproxied instance; rather, I can point you to the class level to
look at.
Gili
--
View this message in context: http://n2.nabble.com/Simplifying-Jersey-life-cycle-and-IoC-integration-tp1367641p1572648.html
Sent from the Jersey mailing list archive at Nabble.com.