当前位置: 首页>>代码示例>>Java>>正文


Java PluginEnvironmentConfig类代码示例

本文整理汇总了Java中org.killbill.billing.plugin.core.config.PluginEnvironmentConfig的典型用法代码示例。如果您正苦于以下问题:Java PluginEnvironmentConfig类的具体用法?Java PluginEnvironmentConfig怎么用?Java PluginEnvironmentConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PluginEnvironmentConfig类属于org.killbill.billing.plugin.core.config包,在下文中一共展示了PluginEnvironmentConfig类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.killbill.billing.plugin.core.config.PluginEnvironmentConfig; //导入依赖的package包/类
@Override
public void start(final BundleContext context) throws Exception {
    super.start(context);

    final String region = PluginEnvironmentConfig.getRegion(configProperties.getProperties());

    // Register an event listener for plugin configuration (optional)
    emailNotificationConfigurationHandler = new EmailNotificationConfigurationHandler(region, PLUGIN_NAME, killbillAPI, logService, dataSource);
    final EmailNotificationConfiguration globalConfiguration = emailNotificationConfigurationHandler.createConfigurable(configProperties.getProperties());
    emailNotificationConfigurationHandler.setDefaultConfigurable(globalConfiguration);

    final PluginConfigurationEventHandler handler = new PluginConfigurationEventHandler(emailNotificationConfigurationHandler);
    dispatcher.registerEventHandlers(handler);

    // Register an event listener (optional)
    emailNotificationListener = new EmailNotificationListener(clock, logService, killbillAPI, configProperties, dataSource, emailNotificationConfigurationHandler);
    dispatcher.registerEventHandlers(emailNotificationListener);

    // Register a servlet (optional)
    final PluginApp pluginApp = new PluginAppBuilder(PLUGIN_NAME,
                                                     killbillAPI,
                                                     logService,
                                                     dataSource,
                                                     super.clock,
                                                     configProperties).withRouteClass(EmailNotificationServlet.class)
                                                                      .build();
    final HttpServlet httpServlet = PluginApp.createServlet(pluginApp);
    registerServlet(context, httpServlet);
}
 
开发者ID:killbill,项目名称:killbill-email-notifications-plugin,代码行数:30,代码来源:EmailNotificationActivator.java

示例2: start

import org.killbill.billing.plugin.core.config.PluginEnvironmentConfig; //导入依赖的package包/类
@Override
public void start(final BundleContext context) throws Exception {
    super.start(context);

    final String region = PluginEnvironmentConfig.getRegion(configProperties.getProperties());

    // Register an event listener for plugin configuration (optional)
    helloWorldConfigurationHandler = new HelloWorldConfigurationHandler(region, PLUGIN_NAME, killbillAPI, logService);
    final Properties globalConfiguration = helloWorldConfigurationHandler.createConfigurable(configProperties.getProperties());
    helloWorldConfigurationHandler.setDefaultConfigurable(globalConfiguration);

    // Register an event listener (optional)
    killbillEventHandler = new HelloWorldListener(killbillAPI);

    // As an example, this plugin registers a PaymentPluginApi (this could be changed to any other plugin api)
    final PaymentPluginApi paymentPluginApi = new HelloWorldPaymentPluginApi(configProperties.getProperties(), logService);
    registerPaymentPluginApi(context, paymentPluginApi);

    // Expose a healthcheck (optional), so other plugins can check on the plugin status
    final Healthcheck healthcheck = new HelloWorldHealthcheck();
    registerHealthcheck(context, healthcheck);

    // Register a servlet (optional)
    final PluginApp pluginApp = new PluginAppBuilder(PLUGIN_NAME,
                                                     killbillAPI,
                                                     logService,
                                                     dataSource,
                                                     super.clock,
                                                     configProperties).withRouteClass(HelloWorldServlet.class)
                                                                      .withRouteClass(HelloWorldHealthcheckServlet.class)
                                                                      .withService(healthcheck)
                                                                      .build();
    final HttpServlet httpServlet = PluginApp.createServlet(pluginApp);
    registerServlet(context, httpServlet);

    registerHandlers();
}
 
开发者ID:killbill,项目名称:killbill-hello-world-java-plugin,代码行数:38,代码来源:HelloWorldActivator.java

示例3: start

import org.killbill.billing.plugin.core.config.PluginEnvironmentConfig; //导入依赖的package包/类
@Override
public void start(final BundleContext context) throws Exception {
    super.start(context);

    final Clock clock = new DefaultClock();
    final AdyenDao dao = new AdyenDao(dataSource.getDataSource());

    final String region = PluginEnvironmentConfig.getRegion(configProperties.getProperties());
    adyenConfigurationHandler = new AdyenConfigurationHandler(PLUGIN_NAME, killbillAPI, logService, region);
    adyenConfigPropertiesConfigurationHandler = new AdyenConfigPropertiesConfigurationHandler(PLUGIN_NAME, killbillAPI, logService, region);
    adyenHostedPaymentPageConfigurationHandler = new AdyenHostedPaymentPageConfigurationHandler(PLUGIN_NAME, killbillAPI, logService, region);
    adyenRecurringConfigurationHandler = new AdyenRecurringConfigurationHandler(PLUGIN_NAME, killbillAPI, logService, region);

    final AdyenPaymentServiceProviderPort globalAdyenClient = adyenConfigurationHandler.createConfigurable(configProperties.getProperties());
    adyenConfigurationHandler.setDefaultConfigurable(globalAdyenClient);

    final AdyenConfigProperties adyenConfigProperties = adyenConfigPropertiesConfigurationHandler.createConfigurable(configProperties.getProperties());
    adyenConfigPropertiesConfigurationHandler.setDefaultConfigurable(adyenConfigProperties);

    final AdyenPaymentServiceProviderHostedPaymentPagePort globalAdyenHppClient = adyenHostedPaymentPageConfigurationHandler.createConfigurable(configProperties.getProperties());
    adyenHostedPaymentPageConfigurationHandler.setDefaultConfigurable(globalAdyenHppClient);

    final AdyenRecurringClient globalAdyenRecurringClient = adyenRecurringConfigurationHandler.createConfigurable(configProperties.getProperties());
    adyenRecurringConfigurationHandler.setDefaultConfigurable(globalAdyenRecurringClient);

    // Expose the healthcheck, so other plugins can check on the Adyen status
    final AdyenHealthcheck adyenHealthcheck = new AdyenHealthcheck(adyenConfigPropertiesConfigurationHandler);
    registerHealthcheck(context, adyenHealthcheck);

    // Register the servlet
    final PluginApp pluginApp = new PluginAppBuilder(PLUGIN_NAME,
                                                     killbillAPI,
                                                     logService,
                                                     dataSource,
                                                     super.clock,
                                                     configProperties).withRouteClass(AdyenServlet.class)
                                                                      .withRouteClass(AdyenHealthcheckServlet.class)
                                                                      .withService(adyenHealthcheck)
                                                                      .build();
    final HttpServlet adyenServlet = PluginApp.createServlet(pluginApp);
    registerServlet(context, adyenServlet);

    // Register the payment plugin
    final AdyenPaymentPluginApi pluginApi = new AdyenPaymentPluginApi(adyenConfigurationHandler,
                                                                      adyenConfigPropertiesConfigurationHandler,
                                                                      adyenHostedPaymentPageConfigurationHandler,
                                                                      adyenRecurringConfigurationHandler,
                                                                      killbillAPI,
                                                                      configProperties,
                                                                      logService,
                                                                      clock,
                                                                      dao);
    registerPaymentPluginApi(context, pluginApi);
    registerHandlers();
}
 
开发者ID:killbill,项目名称:killbill-adyen-plugin,代码行数:56,代码来源:AdyenActivator.java


注:本文中的org.killbill.billing.plugin.core.config.PluginEnvironmentConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。