Created
October 7, 2014 14:05
-
-
Save bitbrain/d04fa8b034c9aa2fd414 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.bitbrain.guice; | |
import com.google.inject.AbstractModule; | |
import com.google.inject.matcher.Matchers; | |
import com.google.inject.name.Names; | |
public class FooBarModule extends AbstractModule { | |
@Override | |
protected void configure() { | |
StateScope scope = new StateScope(); | |
bindScope(StateScoped.class, scope); | |
bind(StateScope.class) | |
.annotatedWith(Names.named("stateScope")) | |
.toInstance(scope); | |
bind(StateHandler.class).asEagerSingleton(); | |
bind(FooState.class); | |
bind(BarState.class); | |
bind(Renderer.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment