/** * Starts the module instance * * @param inModuleURN the module instance URN uniquely identifying * the module that needs to be started. * * @throws ModuleStateException if the module is not in the correct * state to be started. * @throws ModuleException if {@link Module#preStart()} threw an exception * OR if there were other errors starting the module. * @throws InvalidURNException if the module URN is invalid * @throws ModuleNotFoundException if the module was not found */ public void start(ModuleURN inModuleURN) throws ModuleException { startModule(getModule(inModuleURN)); }
Module m = getModule(moduleURN); if(m.getState().isStarted()) { stop(moduleURN);
/** * Stops a module instance. Do note that stopping a module stops * all the data flows that this module initiated. * * However, if the module is participating in data flows that it * didn't initiate, the module cannot be stopped. The user has * to manually cancel other data flows that the module is participating * in, in order to be able to stop it. * * @param inModuleURN the module instance URN uniquely identifying * the module that needs to be stopped. * * @throws ModuleNotFoundException if a module with the supplied * URN was not found * @throws InvalidURNException if the supplied module URN is invalid. * @throws ModuleStateException if the module is not in the correct state * to be stopped. * @throws DataFlowException if the module is participating in data flows * that it didn't initiate. * @throws ModuleException if {@link Module#preStop()} threw an exception * or if there were other errors stopping the module. */ public void stop(ModuleURN inModuleURN) throws ModuleException { stopModule(getModule(inModuleURN)); }
/** * Returns detailed information on the module given its URN. * * @param inModuleURN the module URN * * @return the detailed module information. * * @throws ModuleNotFoundException if a module with the supplied * URN was not found * @throws InvalidURNException if the supplied URN was invalid. */ public ModuleInfo getModuleInfo(ModuleURN inModuleURN) throws ModuleNotFoundException, InvalidURNException { Module module = getModule(inModuleURN); Set<DataFlowID> initiatedFlows = mDataFlows.getInitiatedFlows(inModuleURN); Set<DataFlowID> participatingFlows = mDataFlows.getFlowsParticipating(inModuleURN); return module.getModuleInfo( initiatedFlows == null ? null : initiatedFlows.toArray(new DataFlowID[initiatedFlows.size()]), participatingFlows == null ? null : participatingFlows.toArray(new DataFlowID[participatingFlows.size()])); }
((SinkModule)getModule(SinkModuleFactory.INSTANCE_URN)).setManager(this); registerMXBean(new ModuleManagerMXBeanImpl(this), new ObjectName(MODULE_MBEAN_NAME));
getModule(inModule.getURN());
modules[modules.length - 1] = getModule( SinkModuleFactory.INSTANCE_URN);