@Test public void testConfigure() throws Exception { try { Guice.createInjector(new AuditLogModule()); } catch (CreationException ignored) { } }
@Override protected void configure() { LOGGER.debug("installing module: {}", AuditLogModule.class.getSimpleName()); install(new EventLogModule()); Properties properties = create(PROPERTY_NAME, AuditLogModule.class); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_CORE)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.core", properties, "2"))); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_MAX)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.max", properties, "4"))); String auditLogListenerClass = getProperty("auditlog.listener.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogListenerImpl"); try { @SuppressWarnings("unchecked") Class<AuditLogListener> auditLogListenerImplClass = (Class<AuditLogListener>) forName(auditLogListenerClass); bind(AuditLogListener.class).to(auditLogListenerImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogListenerClass, e); } bind(Integer.class).annotatedWith(named(AUDITLOG_FETCHLIMIT)).toInstance( parseInt(getProperty("auditlog.fetchlimit", properties, "10000"))); String auditLogClass = getProperty("auditlog.implementation.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogImpl"); try { @SuppressWarnings("unchecked") Class<AuditLog> auditLogImplClass = (Class<AuditLog>) forName(auditLogClass); bind(AuditLog.class).to(auditLogImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogClass, e); } LOGGER.debug("installed module: {}", AuditLogModule.class.getSimpleName()); }
AuditLogModule extends AbstractModule { @Override protected void configure() { LOGGER.debug("installing module: {}", AuditLogModule.class.getSimpleName()); install(new EventLogModule()); Properties properties = create(PROPERTY_NAME, AuditLogModule.class); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_CORE)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.core", properties, "2"))); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_MAX)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.max", properties, "4"))); String auditLogListenerClass = getProperty("auditlog.listener.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogListenerImpl"); try { @SuppressWarnings("unchecked") Class<AuditLogListener> auditLogListenerImplClass = (Class<AuditLogListener>) forName(auditLogListenerClass); bind(AuditLogListener.class).to(auditLogListenerImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogListenerClass, e); } bind(Integer.class).annotatedWith(named(AUDITLOG_FETCHLIMIT)).toInstance( parseInt(getProperty("auditlog.fetchlimit", properties, "10000"))); String auditLogClass = getProperty("auditlog.implementation.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogImpl"); try { @SuppressWarnings("unchecked") Class<AuditLog> auditLogImplClass = (Class<AuditLog>) forName(auditLogClass); bind(AuditLog.class).to(auditLogImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogClass, e); } LOGGER.debug("installed module: {}", AuditLogModule.class.getSimpleName()); } }
AuditLogModule extends AbstractModule { @Override protected void configure() { LOGGER.debug("installing module: {}", AuditLogModule.class.getSimpleName()); install(new EventLogModule()); Properties properties = create(PROPERTY_NAME, AuditLogModule.class); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_CORE)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.core", properties, "2"))); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_MAX)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.max", properties, "4"))); String auditLogListenerClass = getProperty("auditlog.listener.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogListenerImpl"); try { @SuppressWarnings("unchecked") Class<AuditLogListener> auditLogListenerImplClass = (Class<AuditLogListener>) forName(auditLogListenerClass); bind(AuditLogListener.class).to(auditLogListenerImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogListenerClass, e); } bind(Integer.class).annotatedWith(named(AUDITLOG_FETCHLIMIT)).toInstance( parseInt(getProperty("auditlog.fetchlimit", properties, "10000"))); String auditLogClass = getProperty("auditlog.implementation.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogImpl"); try { @SuppressWarnings("unchecked") Class<AuditLog> auditLogImplClass = (Class<AuditLog>) forName(auditLogClass); bind(AuditLog.class).to(auditLogImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogClass, e); } LOGGER.debug("installed module: {}", AuditLogModule.class.getSimpleName()); }  }
AuditLogModule extends AbstractModule { @Override protected void configure() { LOGGER.debug("installing module: {}", AuditLogModule.class.getSimpleName()); install(new EventLogModule()); Properties properties = create(PROPERTY_NAME, AuditLogModule.class); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_CORE)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.core", properties, "2"))); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_MAX)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.max", properties, "4"))); String auditLogListenerClass = getProperty("auditlog.listener.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogListenerImpl"); try { @SuppressWarnings("unchecked") Class<AuditLogListener> auditLogListenerImplClass = (Class<AuditLogListener>) forName(auditLogListenerClass); bind(AuditLogListener.class).to(auditLogListenerImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogListenerClass, e); } bind(Integer.class).annotatedWith(named(AUDITLOG_FETCHLIMIT)).toInstance( parseInt(getProperty("auditlog.fetchlimit", properties, "10000"))); String auditLogClass = getProperty("auditlog.implementation.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogImpl"); try { @SuppressWarnings("unchecked") Class<AuditLog> auditLogImplClass = (Class<AuditLog>) forName(auditLogClass); bind(AuditLog.class).to(auditLogImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogClass, e); } LOGGER.debug("installed module: {}", AuditLogModule.class.getSimpleName()); }   }
AuditLogModule extends AbstractModule { @Override protected void configure() { LOGGER.debug("installing module: {}", AuditLogModule.class.getSimpleName()); install(new EventLogModule()); Properties properties = create(PROPERTY_NAME, AuditLogModule.class); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_CORE)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.core", properties, "2"))); bind(Integer.class).annotatedWith(named(AUDITLOG_THREADPOOLSIZE_MAX)).toInstance( parseInt(getProperty("auditlog.threadpoolsize.max", properties, "4"))); String auditLogListenerClass = getProperty("auditlog.listener.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogListenerImpl"); try { @SuppressWarnings("unchecked") Class<AuditLogListener> auditLogListenerImplClass = (Class<AuditLogListener>) forName(auditLogListenerClass); bind(AuditLogListener.class).to(auditLogListenerImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogListenerClass, e); } bind(Integer.class).annotatedWith(named(AUDITLOG_FETCHLIMIT)).toInstance( parseInt(getProperty("auditlog.fetchlimit", properties, "10000"))); String auditLogClass = getProperty("auditlog.implementation.class.name", properties, "com.intuit.wasabi.auditlog.impl.NoopAuditLogImpl"); try { @SuppressWarnings("unchecked") Class<AuditLog> auditLogImplClass = (Class<AuditLog>) forName(auditLogClass); bind(AuditLog.class).to(auditLogImplClass).asEagerSingleton(); } catch (ClassNotFoundException e) { throw new AuditLogException("unable to find class: " + auditLogClass, e); } LOGGER.debug("installed module: {}", AuditLogModule.class.getSimpleName()); }   static final String PROPERTY_NAME; }