public final class BaseExecutionDescriptor extends Object
BaseExecutionService
.
Thread safety of this class depends on type of objects passed to its configuration methods. If these objects are immutable, resulting descriptor is immutable as well. It these objects are thread safe, resulting descriptor is thread safe as well.
BaseExecutionService
Modifier and Type | Class and Description |
---|---|
static interface |
BaseExecutionDescriptor.InputProcessorFactory
Factory creating the input processor.
|
static interface |
BaseExecutionDescriptor.ReaderFactory
Factory creating the reader.
|
Constructor and Description |
---|
BaseExecutionDescriptor()
Creates the new descriptor.
|
Modifier and Type | Method and Description |
---|---|
BaseExecutionDescriptor |
charset(Charset charset)
Returns a descriptor with configured charset.
|
BaseExecutionDescriptor |
errProcessorFactory(BaseExecutionDescriptor.InputProcessorFactory errProcessorFactory)
Returns a descriptor with configured factory for standard error output
processor.
|
BaseExecutionDescriptor |
inReaderFactory(BaseExecutionDescriptor.ReaderFactory inReaderFactory)
Returns a descriptor with configured factory for standard input reader.
|
BaseExecutionDescriptor |
outProcessorFactory(BaseExecutionDescriptor.InputProcessorFactory outProcessorFactory)
Returns a descriptor with configured factory for standard output
processor.
|
BaseExecutionDescriptor |
postExecution(ParametrizedRunnable<Integer> postExecution)
Returns a descriptor with configured post execution runnable.
|
BaseExecutionDescriptor |
preExecution(Runnable preExecution)
Returns a descriptor with configured pre execution runnable.
|
public BaseExecutionDescriptor()
null
.@NonNull @CheckReturnValue public BaseExecutionDescriptor charset(@NullAllowed Charset charset)
null
the BaseExecutionService
will
use the given charset to decode the process streams. When
null
the platform default will be used.
Note that in the most common scenario of execution of OS native process you shouldn't need to set the charset. The platform default (which is the default used) is just the right choice.
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
charset
- charset, null
allowed@NonNull @CheckReturnValue public BaseExecutionDescriptor preExecution(@NullAllowed Runnable preExecution)
BaseExecutionService.run()
).
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
preExecution
- pre execution runnable, null
allowed@NonNull @CheckReturnValue public BaseExecutionDescriptor postExecution(@NullAllowed ParametrizedRunnable<Integer> postExecution)
BaseExecutionService.run()
).
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
postExecution
- post execution runnable, null
allowed@NonNull @CheckReturnValue public BaseExecutionDescriptor outProcessorFactory(@NullAllowed BaseExecutionDescriptor.InputProcessorFactory outProcessorFactory)
BaseExecutionService
to create
processor for standard output.
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
outProcessorFactory
- factory for standard output processor,
null
allowed@NonNull @CheckReturnValue public BaseExecutionDescriptor errProcessorFactory(@NullAllowed BaseExecutionDescriptor.InputProcessorFactory errProcessorFactory)
BaseExecutionService
to create
processor for standard error output.
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
errProcessorFactory
- factory for standard error output processor,
null
allowed@NonNull @CheckReturnValue public BaseExecutionDescriptor inReaderFactory(@NullAllowed BaseExecutionDescriptor.ReaderFactory inReaderFactory)
BaseExecutionService
to create
a reader providing input to the process.
The default (not configured) value is null
.
All other properties of the returned descriptor are inherited from
this
.
inReaderFactory
- factory for standard input reader,
null
allowed