How can I obtain a reference to the MessageBus inside my Seam web
application on the server side?
I see that the ServerMessageBusImpl is being injected by Guice in
AbstractErraiServlet, but the injector instance seems to be private. So
even if I use Guice myself, it will be a different injector, and hence a
different singleton scope, right?
It looks like all the ErraiBus examples have server classes annotated
with @Service, and constructors which @Inject the MessageBus. I'm not
sure if I can do exactly that. For the moment, I would like to
construct the objects myself. If I could obtain the right Guice
injector, I could call Injector.injectMembers on the objects which need
the MessageBus.
Hmm. I'm not going to have to re-architect everything, am I? (BTW,
unlike the examples, I'm not implementing MessageCallback on the server,
I just want to send messages on the same bus that my clients are polling.)
So is there some way I can obtain a reference to the Injector or the
ErraiService from "outside"? Or will I have to annotate a class with
@Service? It looks to me as if ErraiServiceConfiguratorImpl wants to
construct the object itself (via Guice), which probably won't work for
Seam components...
Am I going about this all wrong, or what?
Thanks
Sean.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat