本文整理汇总了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();
}
示例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();
}