use of org.skife.config.ConfigurationObjectFactory in project killbill by killbill.
the class CurrencyModule method configure.
@Override
protected void configure() {
final ConfigurationObjectFactory factory = new ConfigurationObjectFactory(skifeConfigSource);
final CurrencyConfig currencyConfig = factory.build(CurrencyConfig.class);
bind(CurrencyConfig.class).toInstance(currencyConfig);
bind(new TypeLiteral<OSGIServiceRegistration<CurrencyPluginApi>>() {
}).toProvider(DefaultCurrencyProviderPluginRegistryProvider.class).asEagerSingleton();
bind(CurrencyConversionApi.class).to(DefaultCurrencyConversionApi.class).asEagerSingleton();
bind(CurrencyService.class).to(DefaultCurrencyService.class).asEagerSingleton();
}
use of org.skife.config.ConfigurationObjectFactory in project killbill by killbill.
the class DefaultOverdueModule method configure.
@Override
protected void configure() {
installOverdueUserApi();
installOverdueConfigCache();
// internal bindings
installOverdueService();
installOverdueWrapperFactory();
installOverdueEmail();
final OverdueProperties config = new ConfigurationObjectFactory(skifeConfigSource).build(OverdueProperties.class);
bind(OverdueProperties.class).toInstance(config);
bind(OverdueListener.class).asEagerSingleton();
bind(OverdueNotifier.class).annotatedWith(Names.named(OVERDUE_NOTIFIER_CHECK_NAMED)).to(OverdueCheckNotifier.class).asEagerSingleton();
bind(OverdueNotifier.class).annotatedWith(Names.named(OVERDUE_NOTIFIER_ASYNC_BUS_NAMED)).to(OverdueAsyncBusNotifier.class).asEagerSingleton();
bind(OverduePoster.class).annotatedWith(Names.named(OVERDUE_NOTIFIER_CHECK_NAMED)).to(OverdueCheckPoster.class).asEagerSingleton();
bind(OverduePoster.class).annotatedWith(Names.named(OVERDUE_NOTIFIER_ASYNC_BUS_NAMED)).to(OverdueAsyncBusPoster.class).asEagerSingleton();
}
use of org.skife.config.ConfigurationObjectFactory in project killbill by killbill.
the class TestDefaultInvoiceFormatter method beforeClass.
@BeforeClass(groups = "fast")
public void beforeClass() throws Exception {
super.beforeClass();
config = new ConfigurationObjectFactory(skifeConfigSource).build(TranslatorConfig.class);
templateEngine = new MustacheTemplateEngine();
}
use of org.skife.config.ConfigurationObjectFactory in project killbill by killbill.
the class DefaultJaxrsModule method configure.
@Override
protected void configure() {
final ConfigurationObjectFactory factory = new ConfigurationObjectFactory(skifeConfigSource);
final JaxrsConfig jaxrsConfig = factory.build(JaxrsConfig.class);
bind(JaxrsConfig.class).toInstance(jaxrsConfig);
bind(JaxrsUriBuilder.class).asEagerSingleton();
bind(JaxrsExecutors.class).asEagerSingleton();
bind(JaxrsService.class).to(DefaultJaxrsService.class).asEagerSingleton();
}
use of org.skife.config.ConfigurationObjectFactory in project meteo by pierre.
the class RealtimeSystemModule method configure.
/**
* Contributes bindings and other configurations for this module to {@code binder}.
* <p/>
* <p><strong>Do not invoke this method directly</strong> to install submodules. Instead use
* {@link com.google.inject.Binder#install(com.google.inject.Module)}, which ensures that {@link com.google.inject.Provides provider methods} are
* discovered.
*/
@Override
public void configure(final Binder binder) {
// JMX
binder.bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer());
// Jetty/Jersey stuff
binder.bind(JacksonJsonProvider.class).asEagerSingleton();
// Main configuration file
final RealtimeSystemConfig config = new ConfigurationObjectFactory(System.getProperties()).build(RealtimeSystemConfig.class);
binder.bind(RealtimeSystemConfig.class).toInstance(config);
// Configure Esper
final Configuration configuration = new Configuration();
if (!config.getEsperConfigurationFile().equals("")) {
configuration.configure(new File(config.getEsperConfigurationFile()));
}
binder.bind(EPServiceProvider.class).toInstance(EPServiceProviderManager.getDefaultProvider(configuration));
// Configure the routes
configureFromFile(binder, config.getConfigurationFile());
}
Aggregations