@Test public void testBindSessionManager() { final MockRealm mockRealm = createMock(MockRealm.class); Injector injector = Guice.createInjector(new ShiroModule() { @Override protected void configureShiro() { bindRealm().to(MockRealm.class); } @Provides public MockRealm createRealm() { return mockRealm; } @Override protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(MyDefaultSessionManager.class); } }); DefaultSecurityManager securityManager = (DefaultSecurityManager) injector.getInstance(SecurityManager.class); assertNotNull(securityManager); assertNotNull(securityManager.getSessionManager()); assertTrue(securityManager.getSessionManager() instanceof MyDefaultSessionManager); }
protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(DefaultSessionManager.class).asEagerSingleton(); }
ShiroModule extends PrivateModule implements Destroyable { protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(DefaultSessionManager.class).asEagerSingleton(); } }
ShiroModule extends PrivateModule implements Destroyable { protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(DefaultSessionManager.class).asEagerSingleton(); }  }
ShiroModule extends PrivateModule implements Destroyable { protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(DefaultSessionManager.class).asEagerSingleton(); }  void configure(); final void destroy(); void add(Destroyable destroyable); }
ShiroModule extends PrivateModule implements Destroyable { protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) { bind.to(DefaultSessionManager.class).asEagerSingleton(); }  void configure(); final void destroy(); void add(Destroyable destroyable);  }