/** * Execute the command <code>cmd</code> as an external process. The process's input and output streams are accessible from * then on via the <code>from()</code> and <code>to()</code> methods; the process's error stream is logged by a separate * <code>StreamLogger</code> thread. * * @see #to() * @see #from() * @see marytts.util.io.StreamLogger * @throws IOException * IOException */ protected void open() throws IOException { assert cmd != null; process = Runtime.getRuntime().exec(cmd); // Workaround for Java 1.4.1 bug: if (System.getProperty("java.vendor").startsWith("Sun") && System.getProperty("java.version").startsWith("1.4.1")) { try { Thread.sleep(1); } catch (InterruptedException e) { } } to = process.getOutputStream(); from = process.getInputStream(); errorLogger = new StreamLogger(process.getErrorStream(), name() + " err", ignorePattern); errorLogger.start(); }
/** * Execute the command <code>cmd</code> as an external process. The process's input and output streams are accessible from * then on via the <code>from()</code> and <code>to()</code> methods; the process's error stream is logged by a separate * <code>StreamLogger</code> thread. * * @see #to() * @see #from() * @see marytts.util.io.StreamLogger * @throws IOException * IOException */ protected void open() throws IOException { assert cmd != null; process = Runtime.getRuntime().exec(cmd); // Workaround for Java 1.4.1 bug: if (System.getProperty("java.vendor").startsWith("Sun") && System.getProperty("java.version").startsWith("1.4.1")) { try { Thread.sleep(1); } catch (InterruptedException e) { } } to = process.getOutputStream(); from = process.getInputStream(); errorLogger = new StreamLogger(process.getErrorStream(), name() + " err", ignorePattern); errorLogger.start(); }
public ProcessTimeoutDestroyer(ExternalModule module) { this.module = module; logger = MaryUtils.getLogger(module.name() + " timer"); // The timer threads must have a higher priority than the // normal threads, in order to make sure they are processed // before any other. setPriority(getPriority() + 1); }
public ProcessTimeoutDestroyer(ExternalModule module) { this.module = module; logger = MaryUtils.getLogger(module.name() + " timer"); // The timer threads must have a higher priority than the // normal threads, in order to make sure they are processed // before any other. setPriority(getPriority() + 1); }
public synchronized void startup() throws Exception { assert state == MODULE_OFFLINE; setExitRequested(false); open(); setNeedToRestart(false); logger = MaryUtils.getLogger(name()); logger.info("Module started (" + inputType() + "->" + outputType() + ", locale " + getLocale() + ")."); state = MODULE_RUNNING; }
public synchronized void startup() throws Exception { assert state == MODULE_OFFLINE; setExitRequested(false); open(); setNeedToRestart(false); logger = MaryUtils.getLogger(name()); logger.info("Module started (" + inputType() + "->" + outputType() + ", locale " + getLocale() + ")."); state = MODULE_RUNNING; }
throw new IOException("Module " + name() + " cannot process.");
throw new IOException("Module " + name() + " cannot process.");
/** * Execute the command <code>cmd</code> as an external process. The process's input and output streams are accessible from * then on via the <code>from()</code> and <code>to()</code> methods; the process's error stream is logged by a separate * <code>StreamLogger</code> thread. * * @see #to() * @see #from() * @see marytts.util.io.StreamLogger * @throws IOException * IOException */ protected void open() throws IOException { assert cmd != null; process = Runtime.getRuntime().exec(cmd); // Workaround for Java 1.4.1 bug: if (System.getProperty("java.vendor").startsWith("Sun") && System.getProperty("java.version").startsWith("1.4.1")) { try { Thread.sleep(1); } catch (InterruptedException e) { } } to = process.getOutputStream(); from = process.getInputStream(); errorLogger = new StreamLogger(process.getErrorStream(), name() + " err", ignorePattern); errorLogger.start(); }
public ProcessTimeoutDestroyer(ExternalModule module) { this.module = module; logger = MaryUtils.getLogger(module.name() + " timer"); // The timer threads must have a higher priority than the // normal threads, in order to make sure they are processed // before any other. setPriority(getPriority() + 1); }
public synchronized void startup() throws Exception { assert state == MODULE_OFFLINE; setExitRequested(false); open(); setNeedToRestart(false); logger = MaryUtils.getLogger(name()); logger.info("Module started (" + inputType() + "->" + outputType() + ", locale " + getLocale() + ")."); state = MODULE_RUNNING; }
throw new IOException("Module " + name() + " cannot process.");