com.google.inject.spring
Class SpringIntegration

java.lang.Object
  extended by com.google.inject.spring.SpringIntegration

public class SpringIntegration
extends Object

Integrates Guice with Spring.


Method Summary
static void bindAll(Binder binder, org.springframework.beans.factory.ListableBeanFactory beanFactory)
          Binds all Spring beans from the given factory by name.
static
<T> Provider<T>
fromSpring(Class<T> type, String name)
          Creates a provider which looks up objects from Spring using the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromSpring

public static <T> Provider<T> fromSpring(Class<T> type,
                                         String name)
Creates a provider which looks up objects from Spring using the given name. Expects a binding to BeanFactory. Example usage:
 bind(DataSource.class)
   .toProvider(fromSpring(DataSource.class, "dataSource"));
 


bindAll

public static void bindAll(Binder binder,
                           org.springframework.beans.factory.ListableBeanFactory beanFactory)
Binds all Spring beans from the given factory by name. For a Spring bean named "foo", this method creates a binding to the bean's type and @Named("foo").

See Also:
Named, Names.named(String)