提交 64dd2b64 编写于 作者: K kohsuke

refactored for better reusability.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2241 71c3de6d-444a-0410-be80-ed276b4c234a
上级 79f9896e
package hudson.remoting;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
......@@ -19,12 +21,15 @@ public class Launcher {
// and messing up the stream.
OutputStream os = System.out;
System.setOut(System.err);
main(System.in,os);
System.exit(0);
}
public static void main(InputStream is, OutputStream os) throws IOException, InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Channel channel = new Channel("channel", executor, System.in, os);
Channel channel = new Channel("channel", executor, is, os);
System.err.println("channel started");
channel.join();
System.err.println("channel stopped");
System.exit(0);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册