I am currently working on a task that involves migrating a standalone app 
to our company's in house framework. The in house framework uses Guice for 
dependency injection. The standalone app that needs to be migrated to this 
framework uses Spring, Spring-JMS and Spring Batch. Also, the standlone app 
needs to be converted to a web app and deployed in an app/web server. 

The catch here is that my Spring beans will need to be injected with the 
Guice created objects of the framework classes so there is going to be a 
mix and match of Spring and Guice managed objects in my app. 

I have taken a look at SpringIntegration and managed to understand how to 
bind all my Spring managed beans in a Guice module. I also took a look at 
the  @Named Guice annotation that can be used to inject the Spring beans 
with Guice. 

I now have the following questions :

1. Will the Spring beans bound in Guice using SpringIntegration remain 
Singleton or will I need to explicitly add the @Singleton annotation above 
all my Spring managed classes so that Guice treats them as singleton? 

2. In the current standalone application, I programmatically launch my 
Spring batch jobs and start a JMS listener in the main method . I now need 
to deploy my standalone application as a web app in a web server. I need to 
launch my Spring batch jobs and then start the JMS listener automatically 
after the app is deployed. To launch my Spring Batch jobs and JMS listener, 
I need Guice to load my Guice module that will bind my Spring JMS and 
Spring Batch beans. In a standalone app, the main method would have been a 
good enough place to create an injector and then launch the Spring batch 
jobs and start the JMS listener. Where do I create an injector and start my 
jobs and listener in case if a web app? Note that I want to listener and 
the jobs to be started automatically. Also, I am not going to do any Web 
related stuff other than deploying standalone app as a web app in a web 
server.

3. I currently have a Simple factory in my standalone app that has a 
creator method that takes a parameter. The create method gets the 
appropriate bean from the Spring context based on the input paramater 
passed at runtime. What is the Guice way of creating cresting a 
parametrized factory?  

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.

Reply via email to