/** * Orderly shut down the MARY system. * * @throws IllegalStateException * if the MARY system is not running. */ public static void shutdown() { if (currentState != STATE_RUNNING) throw new IllegalStateException("MARY system is not running"); currentState = STATE_SHUTTING_DOWN; logger.info("Shutting down modules..."); // Shut down modules: for (MaryModule m : ModuleRegistry.getAllModules()) { if (m.getState() == MaryModule.MODULE_RUNNING) m.shutdown(); } if (MaryCache.haveCache()) { MaryCache cache = MaryCache.getCache(); try { cache.shutdown(); } catch (SQLException e) { logger.warn("Cannot shutdown cache: ", e); } } logger.info("Shutdown complete."); currentState = STATE_OFF; }
/** * Orderly shut down the MARY system. * * @throws IllegalStateException * if the MARY system is not running. */ public static void shutdown() { if (currentState != STATE_RUNNING) throw new IllegalStateException("MARY system is not running"); currentState = STATE_SHUTTING_DOWN; logger.info("Shutting down modules..."); // Shut down modules: for (MaryModule m : ModuleRegistry.getAllModules()) { if (m.getState() == MaryModule.MODULE_RUNNING) m.shutdown(); } if (MaryCache.haveCache()) { MaryCache cache = MaryCache.getCache(); try { cache.shutdown(); } catch (SQLException e) { logger.warn("Cannot shutdown cache: ", e); } } logger.info("Shutdown complete."); currentState = STATE_OFF; }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
&& m.getState() == MaryModule.MODULE_OFFLINE) { long before = System.currentTimeMillis(); try {
&& m.getState() == MaryModule.MODULE_OFFLINE) { long before = System.currentTimeMillis(); try {
/** * Orderly shut down the MARY system. * * @throws IllegalStateException * if the MARY system is not running. */ public static void shutdown() { if (currentState != STATE_RUNNING) throw new IllegalStateException("MARY system is not running"); currentState = STATE_SHUTTING_DOWN; logger.info("Shutting down modules..."); // Shut down modules: for (MaryModule m : ModuleRegistry.getAllModules()) { if (m.getState() == MaryModule.MODULE_RUNNING) m.shutdown(); } if (MaryCache.haveCache()) { MaryCache cache = MaryCache.getCache(); try { cache.shutdown(); } catch (SQLException e) { logger.warn("Cannot shutdown cache: ", e); } } logger.info("Shutdown complete."); currentState = STATE_OFF; }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
&& m.getState() == MaryModule.MODULE_OFFLINE) { long before = System.currentTimeMillis(); try {