
package cn.orionsec.ops.handler.exec;

import cn.orionsec.kit.lang.able.Executable;
import cn.orionsec.kit.lang.able.SafeCloseable;

public interface IExecHandler extends Runnable, Executable, SafeCloseable {

    /**
     * 写入
     *
     * @param out out
     */
    void write(String out);

    /**
     * 停止
     */
    void terminate();

    /**
     * 获取实际执行 handler
     *
     * @param execId execId
     * @return handler
     */
    static IExecHandler with(Long execId) {
        return new CommandExecHandler(execId);
    }

}
