}
private void pollRMDSide(SequenceEntry entry, boolean force) throws AxisFault {
if(log.isDebugEnabled()) log.debug("Enter: PollingManager::pollRMDSide, force: " + force);
RMDBeanMgr nextMsgMgr = storageManager.getRMDBeanMgr();
RMDBean findBean = new RMDBean();
findBean.setPollingMode(true);
findBean.setTerminated(false);
findBean.setSequenceID(entry.getSequenceId());
RMDBean nextMsgBean = nextMsgMgr.findUnique(findBean);
if(nextMsgBean == null) {
// This sequence must have been terminated, or deleted
stopThreadForSequence(entry.getSequenceId(), false);
} else {
// The sequence is still there, but if we have a running related sequence
// that is not expecting replies then there is no need to poll.
boolean doPoll = true;
String outboundSequence = nextMsgBean.getOutboundInternalSequence();
if(outboundSequence != null) {
RMSBean findRMS = new RMSBean();
findRMS.setInternalSequenceID(outboundSequence);
findRMS.setTerminated(false);
RMSBeanMgr mgr = storageManager.getRMSBeanMgr();
RMSBean outbound = mgr.findUnique(findRMS);
if(outbound != null && outbound.getExpectedReplies() == 0) {
doPoll = false;
}
}
if(force || doPoll)
pollForSequence(null, null, nextMsgBean.getReferenceMessageKey(), nextMsgBean, entry);
}
if(log.isDebugEnabled()) log.debug("Exit: PollingManager::pollRMDSide");
}