use of org.skife.config.ConfigurationObjectFactory in project killbill by killbill.
the class DefaultInvoiceModule method installNotifiers.
protected void installNotifiers() {
bind(NextBillingDateNotifier.class).to(DefaultNextBillingDateNotifier.class).asEagerSingleton();
bind(NextBillingDatePoster.class).to(DefaultNextBillingDatePoster.class).asEagerSingleton();
final TranslatorConfig config = new ConfigurationObjectFactory(skifeConfigSource).build(TranslatorConfig.class);
bind(TranslatorConfig.class).toInstance(config);
bind(InvoiceFormatterFactory.class).to(config.getInvoiceFormatterFactoryClass()).asEagerSingleton();
}
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 druid by druid-io.
the class DruidCoordinatorConfigTest method testDeserialization.
@Test
public void testDeserialization() throws Exception {
ConfigurationObjectFactory factory = Config.createFactory(new Properties());
//with defaults
DruidCoordinatorConfig config = factory.build(DruidCoordinatorConfig.class);
Assert.assertEquals(new Duration("PT300s"), config.getCoordinatorStartDelay());
Assert.assertEquals(new Duration("PT60s"), config.getCoordinatorPeriod());
Assert.assertEquals(new Duration("PT1800s"), config.getCoordinatorIndexingPeriod());
Assert.assertFalse(config.isMergeSegments());
Assert.assertFalse(config.isConvertSegments());
Assert.assertFalse(config.isKillSegments());
Assert.assertEquals(86400000, config.getCoordinatorKillPeriod().getMillis());
Assert.assertEquals(-1000, config.getCoordinatorKillDurationToRetain().getMillis());
Assert.assertEquals(0, config.getCoordinatorKillMaxSegments());
Assert.assertEquals(new Duration(15 * 60 * 1000), config.getLoadTimeoutDelay());
Assert.assertNull(config.getConsoleStatic());
Assert.assertEquals(Duration.millis(50), config.getLoadQueuePeonRepeatDelay());
//with non-defaults
Properties props = new Properties();
props.setProperty("druid.coordinator.startDelay", "PT1s");
props.setProperty("druid.coordinator.period", "PT1s");
props.setProperty("druid.coordinator.period.indexingPeriod", "PT1s");
props.setProperty("druid.coordinator.merge.on", "true");
props.setProperty("druid.coordinator.conversion.on", "true");
props.setProperty("druid.coordinator.kill.on", "true");
props.setProperty("druid.coordinator.kill.period", "PT1s");
props.setProperty("druid.coordinator.kill.durationToRetain", "PT1s");
props.setProperty("druid.coordinator.kill.maxSegments", "10000");
props.setProperty("druid.coordinator.load.timeout", "PT1s");
props.setProperty("druid.coordinator.console.static", "test");
props.setProperty("druid.coordinator.loadqueuepeon.repeatDelay", "PT0.100s");
factory = Config.createFactory(props);
config = factory.build(DruidCoordinatorConfig.class);
Assert.assertEquals(new Duration("PT1s"), config.getCoordinatorStartDelay());
Assert.assertEquals(new Duration("PT1s"), config.getCoordinatorPeriod());
Assert.assertEquals(new Duration("PT1s"), config.getCoordinatorIndexingPeriod());
Assert.assertTrue(config.isMergeSegments());
Assert.assertTrue(config.isConvertSegments());
Assert.assertTrue(config.isKillSegments());
Assert.assertEquals(new Duration("PT1s"), config.getCoordinatorKillPeriod());
Assert.assertEquals(new Duration("PT1s"), config.getCoordinatorKillDurationToRetain());
Assert.assertEquals(10000, config.getCoordinatorKillMaxSegments());
Assert.assertEquals(new Duration("PT1s"), config.getLoadTimeoutDelay());
Assert.assertEquals("test", config.getConsoleStatic());
Assert.assertEquals(Duration.millis(100), config.getLoadQueuePeonRepeatDelay());
}
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 CatalogModule method installConfig.
protected void installConfig() {
final CatalogConfig config = new ConfigurationObjectFactory(skifeConfigSource).build(CatalogConfig.class);
bind(CatalogConfig.class).toInstance(config);
}
Aggregations