package lc.mecha.exec;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Classes implementing this interface represent a batch script which can be applied to some kind of
 * {@link BatchExecutor}.
 *
 * @author Alex Leigh
 */
public interface BatchTask {
    /**
     * Write the script to the given output stream. It is not necessary to <code>close()</code> or
     * <code>flush()</code> the stream.
     */
    void writeScript(OutputStream os) throws IOException;

    /**
     * Called when the script is finished.
     */
    void finished(String result) throws IOException;
}
