private void pollRMSSide(SequenceEntry entry, boolean force) throws AxisFault {
if(log.isDebugEnabled()) log.debug("Enter: PollingManager::pollRMSSide, force: " + force);
RMSBeanMgr rmsBeanManager = storageManager.getRMSBeanMgr();
RMSBean findRMS = new RMSBean();
findRMS.setInternalSequenceID(entry.getSequenceId());
findRMS.setPollingMode(true);
findRMS.setTerminated(false);
RMSBean beanToPoll = rmsBeanManager.findUnique(findRMS);
if(beanToPoll == null) {
// This sequence must have been terminated, or deleted
stopThreadForSequence(entry.getSequenceId(), true);
} else {
if (log.isDebugEnabled())
log.debug("Polling rms " + beanToPoll);
// The sequence is there, but we still only poll if we are expecting reply messages,
// or if we don't have clean ack state. (We assume acks are clean, and only unset
// this if we find evidence to the contrary).
boolean cleanAcks = true;
if (beanToPoll.getNextMessageNumber() > -1)
cleanAcks = AcknowledgementManager.verifySequenceCompletion(beanToPoll.getClientCompletedMessages(), beanToPoll.getNextMessageNumber());
long repliesExpected = beanToPoll.getExpectedReplies();
if((force || !cleanAcks || repliesExpected > 0) && beanToPoll.getReferenceMessageStoreKey() != null)
pollForSequence(beanToPoll.getAnonymousUUID(), beanToPoll.getInternalSequenceID(), beanToPoll.getReferenceMessageStoreKey(), beanToPoll, entry);
}
if(log.isDebugEnabled()) log.debug("Exit: PollingManager::pollRMSSide");
}