63 OutputStream outStream = socket.getOutputStream(); |
63 OutputStream outStream = socket.getOutputStream(); |
64 Map<String, Consumer<OutputStream>> outputs = new HashMap<>(); |
64 Map<String, Consumer<OutputStream>> outputs = new HashMap<>(); |
65 outputs.put("out", st -> System.setOut(new PrintStream(st, true))); |
65 outputs.put("out", st -> System.setOut(new PrintStream(st, true))); |
66 outputs.put("err", st -> System.setErr(new PrintStream(st, true))); |
66 outputs.put("err", st -> System.setErr(new PrintStream(st, true))); |
67 Map<String, Consumer<InputStream>> input = new HashMap<>(); |
67 Map<String, Consumer<InputStream>> input = new HashMap<>(); |
68 input.put("in", st -> System.setIn(st)); |
68 input.put("in", System::setIn); |
69 forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, outputs, input); |
69 forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, outputs, input); |
70 } |
70 } |
71 |
71 |
72 // These three variables are used by the main JShell process in interrupting |
72 // These three variables are used by the main JShell process in interrupting |
73 // the running process. Access is via JDI, so the reference is not visible |
73 // the running process. Access is via JDI, so the reference is not visible |