Top Constructors Methods
org.graalvm.polyglot.io

pack-priv final Class ProcessHandlerSnippets

Located in compilation unit of org.graalvm.polyglot.io.ProcessHandler.

extends Object
implements ProcessHandler
Class Inheritance
All Implemented Interfaces
org.graalvm.polyglot.io.ProcessHandler

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static ProcessBuilder.Redirect
public Process
start(ProcessHandler.ProcessCommand
the subprocess attributes
command
)

Implements org.graalvm.polyglot.io.ProcessHandler.start.

A request to start a new subprocess with given attributes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ProcessHandlerSnippetsback to summary
pack-priv ProcessHandlerSnippets()

Method Detail

asProcessBuilderRedirectback to summary
private static ProcessBuilder.Redirect asProcessBuilderRedirect(ProcessHandler.Redirect redirect)
startback to summary
public Process start(ProcessHandler.ProcessCommand command) throws IOException

Implements org.graalvm.polyglot.io.ProcessHandler.start.

Doc from org.graalvm.polyglot.io.ProcessHandler.start.

A request to start a new subprocess with given attributes.

The default implementation uses ProcessBuilder to create the new subprocess. The subprocess current working directory is set to ProcessCommand#getDirectory(). The ProcessCommand#getDirectory() value was either explicitely set by the guest language or the FileSystem's current working directory is used. The subprocess environment is set to ProcessCommand#getEnvironment(), the initial value of ProcessBuilder#environment() is cleaned. The ProcessCommand#getEnvironment() contains the environment variables set by guest language and possibly also the JVM process environment depending on value of Builder#allowEnvironmentAccess(org.graalvm.polyglot.EnvironmentAccess).

Implementation example: ProcessHandlerSnippets#example

Parameters
command:ProcessHandler.ProcessCommand

the subprocess attributes

Annotations
@Override
Exceptions
IOException:
if the process fails to execute