Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sisu-users] [SpamSentinel] Re: Problem with the Sisu Extender


 
> In Guice once an injector is created its collection of bindings is
> considered immutable (apart from just-in-time bindings, but they
> ... CUT....
> central service locator. So from the perspective of an
> implementation bound in a given injector it can see all its local
> dependencies plus any external dependencies. Furthermore resolution
> of external dependencies is dynamic, meaning that you can swap in
> alternative implementations while minimizing downtime.


Thanks again for the time you spend to give me all these details.
I just want to point out that my sentence was meant as an example; I was just looking for
a single entry point for performing the injection and originally I did not know that the correct API
would be the BeanLocator till you kindly explained me.
So I was mentioning the Guice Injector or a composite Injector as an example, but of course the
BeanLocator is perfectly fine as well. Also, before looking at the extender I did not know I could
obtain the locator via injection.

> For portability components should try to stick to JSR330 and @Inject
> their dependencies rather than rely on programmatic lookup; then
> ... CUT ....
> [ I discuss this approach in a number of presentations at http:
> //www.slideshare.net/mcculls ]


I'll certainly have a look at your presentations.

> That's possible; here's some example code from the old codebase that
> lets you enhance an existing injector:

>
>     https://github.
> com/sonatype/sisu/blob/master/legacy/wrappers/sisu-inject-
> bean/src/main/java/org/sonatype/guice/bean/containers/SisuGuice.java#L101

>
> This was temporarily shelved in the move to Eclipse because it's
> incomplete and I didn't want to commit to supporting this in the
> first release - but it should reappear at some point :)


Same as above, I don't need the API to be necessarily the injector, the BeanLocator is fine, as long as it can locate bindings
from any bundle in the application, I just did not know that this was the right way to use Sisu in OSGi.

>
> It sounds like either you have multiple locators (effectively a
> split-brain scenario) or for some reason it is not analyzing your
> implementation.  You can always use -Dsisu.debug to turn on internal
> tracing of bindings, etc.


> BTW, here's a simple Swing example that works both in classic and OSGi modes:
>
>    https://github.com/sonatype/sisu/tree/master/examples/guice-swing


I'll have a look, thanks.

GianMaria.

Back to the top