Search in sources :

Example 1 with JMSListenerStartupShutdownListener

use of org.wso2.carbon.apimgt.jms.listener.utils.JMSListenerStartupShutdownListener in project carbon-apimgt by wso2.

the class JMSListenerComponent 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;
    }
    JMSListenerStartupShutdownListener jmsListenerStartupShutdownListener = new JMSListenerStartupShutdownListener();
    registration = context.getBundleContext().registerService(ServerStartupObserver.class, jmsListenerStartupShutdownListener, null);
    registration = context.getBundleContext().registerService(ServerShutdownHandler.class, jmsListenerStartupShutdownListener, null);
    registration = context.getBundleContext().registerService(JMSListenerShutDownService.class, jmsListenerStartupShutdownListener, null);
}
Also used : ServerStartupObserver(org.wso2.carbon.core.ServerStartupObserver) APIManagerConfiguration(org.wso2.carbon.apimgt.impl.APIManagerConfiguration) JMSListenerShutDownService(org.wso2.carbon.apimgt.impl.jms.listener.JMSListenerShutDownService) ServerShutdownHandler(org.wso2.carbon.core.ServerShutdownHandler) JMSListenerStartupShutdownListener(org.wso2.carbon.apimgt.jms.listener.utils.JMSListenerStartupShutdownListener) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

Activate (org.osgi.service.component.annotations.Activate)1 APIManagerConfiguration (org.wso2.carbon.apimgt.impl.APIManagerConfiguration)1 JMSListenerShutDownService (org.wso2.carbon.apimgt.impl.jms.listener.JMSListenerShutDownService)1 JMSListenerStartupShutdownListener (org.wso2.carbon.apimgt.jms.listener.utils.JMSListenerStartupShutdownListener)1 ServerShutdownHandler (org.wso2.carbon.core.ServerShutdownHandler)1 ServerStartupObserver (org.wso2.carbon.core.ServerStartupObserver)1