Package org.jgrapes.io.events
Class StartProcess
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
Starts a new process managed by the
ProcessManager
component that handles the event.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
ConstructorDescriptionStartProcess
(String... command) Signals that a new process should be started.StartProcess
(List<String> command) Signals that a new process should be started. -
Method Summary
Modifier and TypeMethodDescriptionString[]
command()
Returns the command.Returns the directory.Sets the working directory for the process.Returns the environment.environment
(String key, String value) Sets a single value in the environment of the process to be created, seeenvironment(Map)
.environment
(Map<String, String> environment) Sets the environment for the process to be created.Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo, toString
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
StartProcess
Signals that a new process should be started.- Parameters:
command
- the command
-
StartProcess
Signals that a new process should be started.- Parameters:
command
- the command
-
-
Method Details
-
command
Returns the command.- Returns:
- the command
-
directory
Sets the working directory for the process.- Parameters:
directory
- the directory- Returns:
- the event for method chaining
-
directory
Returns the directory.- Returns:
- the directory
-
environment
Sets the environment for the process to be created.The values given will be merged with the defaults used by the
ProcessBuilder
. Overrides any values from a previous invocation or from invokingenvironment(String, String)
.- Parameters:
environment
- the environment- Returns:
- the event for method chaining
-
environment
Returns the environment.- Returns:
- the environment
-
environment
Sets a single value in the environment of the process to be created, seeenvironment(Map)
.- Parameters:
key
- the keyvalue
- the value- Returns:
- the event for method chaining
-