}
}
if (monitoringEnabled) {
context.register(ApplicationInfoListener.class);
context.register(new AbstractBinder() {
@Override
protected void configure() {
bindFactory(ReferencingFactory.<ApplicationInfo>referenceFactory()).to(
new TypeLiteral<Ref<ApplicationInfo>>() {
}
).in(Singleton.class);
bindFactory(ApplicationInfoInjectionFactory.class).to(
ApplicationInfo.class).in(PerLookup.class);
}
});
}
if (statisticsEnabled) {
context.register(MonitoringEventListener.class);
context.register(new AbstractBinder() {
@Override
protected void configure() {
bindFactory(ReferencingFactory.<MonitoringStatistics>referenceFactory()).to(
new TypeLiteral<Ref<MonitoringStatistics>>() {
}).in(Singleton.class);