@bklough - I'll look into your suggestion about getting down into the servlet shortly. I have looked at that developian blog post, as well as the two s/he posted previous to that. There was a lack of explanation there still on the approach taken, which I left a comment there asking about. That said, the blog post is rather old and my comment question may never be noticed. =)
In continued searching and learning, I think I have an approach that I'd like to take, but I don't know if anything is available to support it. In Spring there is the SpringBeanAutowiringInterceptor that instantiates dependency beans in the WebServiceImpl's with an @Autowire annotation. In the language of the javadoc, it "Performs injection after construction as well as after activation of a passivated bean." (See here: http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.html or here: http://www.jarvana.com/jarvana/view/org/springframework/spring-context/3.0.2.RELEASE/spring-context-3.0.2.RELEASE-sources.jar!/org/springframework/ejb/interceptor/SpringBeanAutowiringInterceptor.java?format=ok ). I've seen this Spring interceptor stuff working on a WebServiceImpl in JBoss that was set up nearly identical to how I'm doing it... but I'm trying to use Guice. Is there anything in Guice like unto this SpringBeanAutowiringInterceptor? And another question... Am I really the first person trying to do this? Or perhaps just the first one to be totally inept and making it work! :-) @Ales The more I've worked on this and thought about it, the more I realize I still don't understand something very basic that you said: "You need to understand what you're actually getting with this integration. You only get a way to tell MC' kernel how to lookup / inject your Guice bound instances based on class or key. " I think I only need it to look up based on class, but then I don't really know. My brain is getting too frustrated and fried from all this to know anything anymore! On Jun 10, 9:57 am, bklough <[email protected]> wrote: > http://www.mastertheboss.com/en/web-interfaces/101-jboss-web-services...http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch12.html > > I'm not a JBoss WebService heavy, but it seems there's always a > Servlet mixed in with WebServices at some point in the App Server > config. My hunch is that if you can identify that entry point and > link to the WebService provider, you should be able to tie the > GuiceServlet in there somewhere, or at the very least, your own > Injector init/create code that your Web Services can then use. > > This link below looks the most promising of the lot, but I just > scanned it: > > http://developian.blogspot.com/2008/12/jax-ws-ri-jboss-and-guice.html > > Cheers, good luck, and I'd be interested to hear how you make out. > > On Jun 7, 11:29 am, Mateo <[email protected]> wrote: > > > > > I'm beginning to think I'm making this harder than it needs to be. At > > the risk of playing the fool who couldn't figure out his homework, I > > will attempt to explain how I want to use Guice within JBoss and > > perhaps some merciful soul can point out my ignorance kindly. =) > > > I'll use an extremely simple music database as an example. (There is > > no web front end to this - it's simply acting as a SOAP WS server for > > now.) > > > Annotations on my MusicWebService and Impl create my wsdl. Let's say > > my MusicWebService has a "getSongsByArtist(String artistName)" method. > > Then the flow through my app would be something like: > > MusicWebServiceImpl.getSongsByArtist -> > > SongServiceImpl.getSongsByArtist -> SongDaoImpl.getSongsByArtist > > > The Dao returns a list of Song objects up to the service, which > > returns them up to the Web Service, which then converts them into > > DTO's and sends them back to whoever called it. > > > Where Guice comes in: > > * The MusicWebServiceImpl needs a songService (so my module would have > > something like bind(SongService.class).to(SongServiceImpl); ) > > * The SongServiceImpl needs a songDao. > > > How do I use Guice to inject these? I will use Guice's AOP features to > > set transaction boundaries as well (will be using hibernate), but > > first things first. =) > > > My project will pretty much consist of a whole lot of doing that. > > There will be times my service will also contact another server via > > WSs, which I will be using a Guice @Provides to provide the class > > acting as client to the other WS server... but that's probably beside > > the point right now. > > > So... there's my ignorance in all its glory. Any tips on the right way > > to proceed? Was I on the right path? Or are there any recommendations > > for something specific that I should research? > > > Thanks! -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
