use of org.wso2.carbon.andes.listeners.BrokerLifecycleListener in project carbon-apimgt by wso2.
the class LifecycleComponent method setQpidService.
@Reference(name = "QpidService", service = org.wso2.carbon.andes.service.QpidService.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.DYNAMIC, unbind = "unsetQpidService")
public void setQpidService(QpidService qpidService) {
log.debug("Setting QpidService...");
ServiceReferenceHolder.getInstance().setQpidService(qpidService);
if (qpidService != null) {
qpidService.registerBrokerLifecycleListener(new BrokerLifecycleListener() {
@Override
public void onShuttingdown() {
if (ServiceReferenceHolder.getInstance().getListenerShutdownServices().isEmpty()) {
return;
}
log.debug("Triggering a Shutdown of the Listener...");
for (JMSListenerShutDownService listenerShutdownService : ServiceReferenceHolder.getInstance().getListenerShutdownServices()) {
listenerShutdownService.shutDownListener();
}
}
@Override
public void onShutdown() {
}
});
}
}
Aggregations