My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Guice  

Featured
Updated Nov 27, 2009 by gagari...@gmail.com

Guice integration module makes objects assembled with Google Guice module(-s) transparently availaible in Tapestry.

Usage

To start using your guice-assembled objects just add goodies-guice JAR to classpath and configure GuiceObjectProvider in your Tapestry module:

public static void contributeGuiceObjectProvider(Configuration<Module> configuration) {
    configuration.add(new MyModule());
}

When configured Guice module bindings are available to Tapestry via @Inject annotation:

public class Login {

    @Inject
    private GuiceConfiguredService myService;

}

Note that only explicitly bound objects are available to Tapestry.

public MyModule extends AbstractModule {
    protected configure() {
        bind(MyGuiceService.class); // this makes MyGuiceService visible to Tapestry
    }
}

Sign in to add a comment
Powered by Google Project Hosting