use of org.wso2.carbon.apimgt.throttle.policy.deployer.utils.ThrottlePolicyStartupListener in project carbon-apimgt by wso2.
the class ThrottlePolicyDeployerComponent method activate.
@Activate
protected void activate(ComponentContext context) {
log.debug("Activating component...");
APIManagerConfiguration configuration = ServiceReferenceHolder.getInstance().getAPIMConfiguration();
if (configuration == null) {
log.warn("API Manager Configuration not properly set.");
return;
}
ThrottleProperties throttleProperties = configuration.getThrottleProperties();
if (throttleProperties.isEnablePolicyDeployment()) {
ThrottlePolicyStartupListener throttlePolicyStartupListener = new ThrottlePolicyStartupListener();
registration = context.getBundleContext().registerService(ServerStartupObserver.class, throttlePolicyStartupListener, null);
registration = context.getBundleContext().registerService(ServerShutdownHandler.class, throttlePolicyStartupListener, null);
registration = context.getBundleContext().registerService(JMSListenerShutDownService.class, throttlePolicyStartupListener, null);
}
}
Aggregations