public class Util extends Object
ExecutionControl
. Particularly implementations with remote execution.Modifier and Type | Method | Description |
---|---|---|
static void |
detectJdiExitEvent |
Monitor the JDI event stream for VMDeathEvent and VMDisconnectEvent . |
static void |
forwardExecutionControl |
Forward commands from the input to the specified ExecutionControl instance, then responses back on the output. |
static void |
forwardExecutionControlAndIO |
Forward commands from the input to the specified ExecutionControl instance, then responses back on the output. |
static ExecutionControl |
remoteInputOutput |
Creates an ExecutionControl for given packetized input and output. |
public static void forwardExecutionControl(ExecutionControl ec, ObjectInput in, ObjectOutput out)
ExecutionControl
instance, then responses back on the output.ec
- the direct instance of ExecutionControl
to process commandsin
- the command inputout
- the command response outputpublic static void forwardExecutionControlAndIO(ExecutionControl ec, InputStream inStream, OutputStream outStream, Map<String,Consumer<OutputStream>> outputStreamMap, Map<String,Consumer<InputStream>> inputStreamMap) throws IOException
ExecutionControl
instance, then responses back on the output.ec
- the direct instance of ExecutionControl
to process commandsinStream
- the stream from which to create the command inputoutStream
- the stream that will carry any specified auxiliary channels (like System.out
and System.err
), and the command response output.outputStreamMap
- a map between names of additional streams to carry and setters for the stream. Names starting with '$' are reserved for internal use.inputStreamMap
- a map between names of additional streams to carry and setters for the stream. Names starting with '$' are reserved for internal use.IOException
- if there are errors using the passed streamspublic static ExecutionControl remoteInputOutput(InputStream input, OutputStream output, Map<String,OutputStream> outputStreamMap, Map<String,InputStream> inputStreamMap, BiFunction<ObjectInput,ObjectOutput,ExecutionControl> factory) throws IOException
input
- the packetized input streamoutput
- the packetized output streamoutputStreamMap
- a map between stream names and the output streams to forward. Names starting with '$' are reserved for internal use.inputStreamMap
- a map between stream names and the input streams to forward. Names starting with '$' are reserved for internal use.factory
- to create the ExecutionControl from ObjectInput and ObjectOutput.IOException
- if setting up the streams raised an exceptionpublic static void detectJdiExitEvent(VirtualMachine vm, Consumer<String> unbiddenExitHandler)
VMDeathEvent
and VMDisconnectEvent
. If encountered, invokes unbiddenExitHandler
.vm
- the virtual machine to checkunbiddenExitHandler
- the handler, which will accept the exit information
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.jshell/jdk/jshell/execution/Util.html