use of org.wso2.carbon.apimgt.cache.invalidation.APIMgtCacheInvalidationRequestSender in project carbon-apimgt by wso2.
the class CacheInvalidationServiceComponent method activate.
@Activate
protected void activate(ComponentContext context) {
CacheInvalidationConfiguration cacheInvalidationConfiguration;
BundleContext bundleContext = context.getBundleContext();
if (DataHolder.getInstance().getAPIManagerConfigurationService() != null) {
cacheInvalidationConfiguration = DataHolder.getInstance().getAPIManagerConfigurationService().getAPIManagerConfiguration().getCacheInvalidationConfiguration();
if (cacheInvalidationConfiguration.isEnabled()) {
APIMgtCacheInvalidationRequestSender apiMgtCacheInvalidationRequestSender = new APIMgtCacheInvalidationRequestSender(cacheInvalidationConfiguration);
cacheInvalidationRequestSenderServiceRegistration = bundleContext.registerService(CacheInvalidationRequestSender.class, apiMgtCacheInvalidationRequestSender, null);
cacheInvalidationRequestSenderServiceRegistration = bundleContext.registerService(CacheEntryListener.class, apiMgtCacheInvalidationRequestSender, null);
APIMgtServerStartupListener apimgtCacheInvalidationServerStartupListener = new APIMgtServerStartupListener();
cacheInvalidationRequestSenderServiceRegistration = bundleContext.registerService(ServerStartupObserver.class, apimgtCacheInvalidationServerStartupListener, null);
cacheInvalidationRequestSenderServiceRegistration = bundleContext.registerService(ServerShutdownHandler.class, apimgtCacheInvalidationServerStartupListener, null);
cacheInvalidationRequestSenderServiceRegistration = bundleContext.registerService(JMSListenerShutDownService.class, apimgtCacheInvalidationServerStartupListener, null);
}
}
}
Aggregations