public class

SpringIntegration

extends Object
java.lang.Object
   ↳ com.google.inject.spring.SpringIntegration

Class Overview

Integrates Guice with Spring.

Summary

Public Methods
static void bindAll(Binder binder, 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void bindAll (Binder binder, 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").

public static 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 org.springframework.beans.factory.BeanFactory. Example usage:

 bind(DataSource.class)
   .toProvider(fromSpring(DataSource.class, "dataSource"));