log.debug("Enter: SandeshaUtil::startWorkersForSequence, sequence " + sequence);
StorageManager mgr = getSandeshaStorageManager(context, context.getAxisConfiguration());
boolean polling = sequence.isPollingMode();
SandeshaThread sender = mgr.getSender();
SandeshaThread invoker = mgr.getInvoker();
SandeshaThread pollMgr = mgr.getPollingManager();
// Only start the polling manager if we are configured to use MakeConnection
if(polling && pollMgr == null) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionDisabled);
throw new SandeshaException(message);
}
if(sequence instanceof RMSBean) {
// We pass in the internal sequence id for internal sequences.
String sequenceId = ((RMSBean)sequence).getInternalSequenceID();
sender.runThreadForSequence(context, sequenceId, true);
if(polling) pollMgr.runThreadForSequence(context, sequenceId, true);
} else {
String sequenceId = sequence.getSequenceID();
sender.runThreadForSequence(context, sequenceId, false);
if(invoker != null) invoker.runThreadForSequence(context, sequenceId, false);
if(polling) pollMgr.runThreadForSequence(context, sequenceId, false);
}
if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Exit: SandeshaUtil::startWorkersForSequence");
}