Search in sources :

Example 6 with ConfigurationObjectFactory

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();
}
Also used : DefaultCurrencyService(org.killbill.billing.currency.DefaultCurrencyService) OSGIServiceRegistration(org.killbill.billing.osgi.api.OSGIServiceRegistration) DefaultCurrencyConversionApi(org.killbill.billing.currency.api.DefaultCurrencyConversionApi) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) CurrencyConfig(org.killbill.billing.util.config.definition.CurrencyConfig)

Example 7 with ConfigurationObjectFactory

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();
}
Also used : OverdueAsyncBusPoster(org.killbill.billing.overdue.notification.OverdueAsyncBusPoster) OverdueCheckNotifier(org.killbill.billing.overdue.notification.OverdueCheckNotifier) OverdueProperties(org.killbill.billing.overdue.OverdueProperties) OverdueCheckPoster(org.killbill.billing.overdue.notification.OverdueCheckPoster) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) OverdueNotifier(org.killbill.billing.overdue.notification.OverdueNotifier) OverdueAsyncBusNotifier(org.killbill.billing.overdue.notification.OverdueAsyncBusNotifier) OverduePoster(org.killbill.billing.overdue.notification.OverduePoster) OverdueListener(org.killbill.billing.overdue.listener.OverdueListener)

Example 8 with ConfigurationObjectFactory

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();
}
Also used : MustacheTemplateEngine(org.killbill.billing.util.email.templates.MustacheTemplateEngine) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) TranslatorConfig(org.killbill.billing.util.template.translation.TranslatorConfig) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with ConfigurationObjectFactory

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();
}
Also used : DefaultJaxrsService(org.killbill.billing.jaxrs.DefaultJaxrsService) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) JaxrsExecutors(org.killbill.billing.jaxrs.JaxrsExecutors) JaxrsUriBuilder(org.killbill.billing.jaxrs.util.JaxrsUriBuilder) JaxrsConfig(org.killbill.billing.util.config.definition.JaxrsConfig)

Example 10 with ConfigurationObjectFactory

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());
}
Also used : Configuration(com.espertech.esper.client.Configuration) EPServiceProvider(com.espertech.esper.client.EPServiceProvider) JacksonJsonProvider(org.codehaus.jackson.jaxrs.JacksonJsonProvider) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) File(java.io.File) MBeanServer(javax.management.MBeanServer)

Aggregations

ConfigurationObjectFactory (org.skife.config.ConfigurationObjectFactory)26 Properties (java.util.Properties)4 TranslatorConfig (org.killbill.billing.util.template.translation.TranslatorConfig)4 BeforeClass (org.testng.annotations.BeforeClass)3 Test (org.junit.Test)2 OSGIServiceRegistration (org.killbill.billing.osgi.api.OSGIServiceRegistration)2 RbacConfig (org.killbill.billing.util.config.definition.RbacConfig)2 MustacheTemplateEngine (org.killbill.billing.util.email.templates.MustacheTemplateEngine)2 Configuration (com.espertech.esper.client.Configuration)1 EPServiceProvider (com.espertech.esper.client.EPServiceProvider)1 Injector (com.google.inject.Injector)1 TypeLiteral (com.google.inject.TypeLiteral)1 File (java.io.File)1 MBeanServer (javax.management.MBeanServer)1 AuthenticationInfo (org.apache.shiro.authc.AuthenticationInfo)1 UsernamePasswordToken (org.apache.shiro.authc.UsernamePasswordToken)1 AuthorizationInfo (org.apache.shiro.authz.AuthorizationInfo)1 SimplePrincipalCollection (org.apache.shiro.subject.SimplePrincipalCollection)1 JacksonJsonProvider (org.codehaus.jackson.jaxrs.JacksonJsonProvider)1 Duration (org.joda.time.Duration)1