/** * Cancels the data flow identified by the supplied data flow ID. * Do note that data flows that have been initiated by * {@link #createDataFlow(DataRequest[])} can be canceled by this * method. * * Specifically, data flows created by modules via * {@link org.marketcetera.module.DataFlowSupport#createDataFlow(DataRequest[])} * cannot be canceled by this method. They can only be canceled by the * module that initiated the data flow request. * * @param inFlowID the data flow ID. * * * @throws ModuleStateException If the requesting module is not in the * correct state to be requesting cancellation of data flows. * @throws DataFlowNotFoundException if the data flow corresponding * to the supplied ID wasn't found. * @throws DataFlowException if the data flow is in the process of * being canceled by another operation. */ public void cancel(DataFlowID inFlowID) throws ModuleStateException, DataFlowException { cancel(inFlowID, null); }
@Override public void cancel(DataFlowID inFlowID) throws ModuleException { verifyIncorrectInvocation(); mManager.cancel(inFlowID, mRequester); }
@Override public void cancel(String inFlowID) { try { mManager.cancel(toFlowID(inFlowID)); } catch (I18NException e) { throw transformFailure(e); } }
/** * Cancels the data flow as requested by either the emitter * or receiver module. * * @param inRequester the module requesting cancellation of * the data flow. */ private void cancelDataFlow(Module inRequester) { try { mManager.cancel(mFlowID,inRequester); } catch (Exception e) { Messages.LOG_UNEXPECTED_ERROR_CANCELING_FLOW.error(this, e, mFlowID, inRequester.getURN()); } } /* (non-Javadoc)
/** * Stop the object. */ @PreDestroy public void stop() { for(DataFlowID dataFlowId : dataFlowIds) { try { moduleManager.cancel(dataFlowId); } catch (Exception ignored) {} } dataFlowIds.clear(); for(ModuleDescriptor moduleDescriptor : startModules) { try { moduleManager.stop(moduleDescriptor.getModuleInstanceUrn()); } catch (Exception ignored) {} } for(ModuleURN moduleURN : createdInstances) { try { moduleManager.deleteModule(moduleURN); } catch (Exception ignored) {} createdInstances.clear(); } } /**
if (initiated != null) { for(DataFlowID flowID: initiated) { cancel(flowID);
Messages.LOG_CANCEL_DATA_FLOW_START_FAILED.info( this, id, inModule.getURN()); cancel(id);
cancel(flowID);