View Javadoc

1   package expectj;
2   
3   import java.io.IOException;
4   
5   /***
6    * This interface exists for people who want control over how processes are
7    * launched.
8    * <p>
9    * Implementors are encouraged to implement {@link #toString()} for logging purposes.
10   *
11   * @see ExpectJ#spawn(String)
12   * @author Johan Walles, johan.walles@gmail.com
13   */
14  public interface Executor {
15      /***
16       * Creates a new process. This will only be called once.
17       * @return The new process.
18       * @throws IOException if there's a problem starting the new process.
19       * @see #toString()
20       */
21      Process execute() throws IOException;
22  
23      /***
24       * Describes what {@link #execute()} created.
25       * @return A short description of what {@link #execute()} returns.
26       */
27      public String toString();
28  }