/** * Start the given provider if necessary. * * @param inProviderUrn a <code>ModuleURN</code> value */ private void startProviderIfNecessary(ModuleURN inProviderUrn) { ModuleManager moduleManager = ModuleManager.getInstance(); ModuleInfo moduleInfo = moduleManager.getModuleInfo(inProviderUrn); SLF4JLoggerProxy.debug(this, "{} is {}", inProviderUrn, moduleInfo); if(!moduleInfo.getState().isStarted()) { moduleManager.start(inProviderUrn); } } /**
/** * Returns module info describing the current state of the module. * * @param inInitiatedFlows the set of IDs for the data flows that this * module has initiated * @param inParticipatingFlows the set of IDs for the data flows that this * module is participating in. * * @return the module info. */ final ModuleInfo getModuleInfo(DataFlowID[] inInitiatedFlows, DataFlowID[] inParticipatingFlows) { return new ModuleInfo(getURN(), getState(), inInitiatedFlows, inParticipatingFlows, getCreated(), getStarted(), getStopped(), isAutoStart(), isAutoCreated(), this instanceof DataReceiver, this instanceof DataEmitter, this instanceof DataFlowRequester, getLastStartFailure(), getLastStopFailure(), mLock.getReadLockCount(), mLock.isWriteLocked(), mLock.getQueueLength()); }
ModuleURN instanceUrn = new ModuleURN("metc:mdata:" + moduleName+":single"); ModuleInfo moduleInfo = moduleManager.getModuleInfo(instanceUrn); if(!moduleInfo.getState().isStarted()) { moduleManager.start(instanceUrn);