use of nl.nn.adapterframework.jms.PushingJmsListener in project iaf by ibissource.
the class DefaultIbisManager method unload.
private void unload(Configuration configuration) {
configuration.setUnloadInProgressOrDone(true);
while (configuration.getStartAdapterThreads().size() > 0) {
log.debug("Waiting for start threads to end: " + configuration.getStartAdapterThreads());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.warn("Interrupted waiting for start threads to end", e);
}
}
stopAdapters(configuration);
while (configuration.getStopAdapterThreads().size() > 0) {
log.debug("Waiting for stop threads to end: " + configuration.getStopAdapterThreads());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.warn("Interrupted waiting for stop threads to end", e);
}
}
// destroy all jmsContainers
for (int i = 0; i < configuration.getRegisteredAdapters().size(); i++) {
IAdapter adapter = configuration.getRegisteredAdapter(i);
Iterator recIt = adapter.getReceiverIterator();
if (recIt.hasNext()) {
while (recIt.hasNext()) {
IReceiver receiver = (IReceiver) recIt.next();
if (receiver instanceof ReceiverBase) {
ReceiverBase rb = (ReceiverBase) receiver;
IListener listener = rb.getListener();
if (listener instanceof PushingJmsListener) {
PushingJmsListener pjl = (PushingJmsListener) listener;
pjl.destroy();
}
}
}
}
}
while (configuration.getRegisteredAdapters().size() > 0) {
IAdapter adapter = configuration.getRegisteredAdapter(0);
AdapterService adapterService = configuration.getAdapterService();
adapterService.unRegisterAdapter(adapter);
}
configurations.remove(configuration);
}
Aggregations