1 package test.guice; 2 3 import com.google.inject.AbstractModule; 4 import com.google.inject.Inject; 5 6 public class GuiceTestModule extends AbstractModule { 7 private final MyContext myContext; 8 9 @Inject GuiceTestModule(MyContext myContext)10 GuiceTestModule(MyContext myContext) { 11 this.myContext = myContext; 12 } 13 14 @Override configure()15 protected void configure() { 16 bind(MySession.class).toInstance(myContext.getSession()); 17 } 18 } 19