public class Util extends Object
ExecutionControl. Particularly implementations with remote
execution.| Modifier and Type | Method | Description |
|---|---|---|
static void |
detectJdiExitEvent(com.sun.jdi.VirtualMachine vm,
Consumer<String> unbiddenExitHandler) |
Monitor the JDI event stream for
VMDeathEvent
and VMDisconnectEvent. |
static void |
forwardExecutionControl(ExecutionControl ec,
ObjectInput in,
ObjectOutput out) |
Forward commands from the input to the specified
ExecutionControl
instance, then responses back on the output. |
static void |
forwardExecutionControlAndIO(ExecutionControl ec,
InputStream inStream,
OutputStream outStream,
Map<String,Consumer<OutputStream>> outputStreamMap,
Map<String,Consumer<InputStream>> inputStreamMap) |
Forward commands from the input to the specified
ExecutionControl
instance, then responses back on the output. |
static ExecutionControl |
remoteInputOutput(InputStream input,
OutputStream output,
Map<String,OutputStream> outputStreamMap,
Map<String,InputStream> inputStreamMap,
BiFunction<ObjectInput,ObjectOutput,ExecutionControl> factory) |
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(com.sun.jdi.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 Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2015, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Debian+0-9b155-1