use of nl.nn.adapterframework.core.IListenerConnector in project iaf by ibissource.
the class ListenerPortPoller method poll.
/**
* Poll all registered EjbListenerPortConnector instances to see if they
* are in the same state as their associated listener-ports, and
* toggle their state if not.
*/
public void poll() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
// }
for (Iterator iter = portConnectorList.iterator(); iter.hasNext(); ) {
WeakReference wr = (WeakReference) iter.next();
IListenerConnector elpc = (IListenerConnector) wr.get();
if (elpc == null) {
iter.remove();
continue;
}
// Check for each ListenerPort if it's state matches with the
// state that IBIS thinks it should be in.
IPortConnectedListener listener = getListener(elpc);
try {
if (isClosed(elpc) != isListenerPortClosed(elpc)) {
log.info("State of listener [" + listener.getName() + "] does not match state of WebSphere ListenerPort [" + // + elpc.getListenerPortName(listener)
"] to which it is attached; will try to change state of Receiver [" + listener.getReceiver().getName() + "]");
toggleConfiguratorState(elpc);
}
} catch (Exception ex) {
log.error("Cannot change, or enquire on, state of Listener [" + listener.getName() + "]", ex);
}
}
// if (log.isDebugEnabled()) {
// log.debug("Exit polling " + this.toString() + ", thread: " + Thread.currentThread().getName());
// }
}
Aggregations