1 package hudson.remoting; 2 3 import java.io.OutputStream ; 4 import java.io.IOException ; 5 import java.io.InputStream ; 6 import java.util.concurrent.ExecutorService ; 7 import java.util.concurrent.Executors ; 8 9 18 public class Launcher { 19 public static void main(String [] args) throws Exception { 20 OutputStream os = System.out; 23 System.setOut(System.err); 24 main(System.in,os); 25 System.exit(0); 26 } 27 28 public static void main(InputStream is, OutputStream os) throws IOException , InterruptedException { 29 ExecutorService executor = Executors.newCachedThreadPool(); 30 Channel channel = new Channel("channel", executor, is, os); 31 System.err.println("channel started"); 32 channel.join(); 33 System.err.println("channel stopped"); 34 } 35 } 36 | Popular Tags |