public abstract class AbstractJvmModelExecTask<T extends AbstractJvmExecSpec, P extends SerializableWorkerAppParameters> extends DefaultTask implements ForkedJvmExecutable, JvmExecutionModel
Configures a task that will run an execution in a forked JVM.
Constructor and description |
---|
protected AbstractJvmModelExecTask
(WorkerExecutor we) Base class for executing tasks on the JVM. |
Type Params | Return Type | Name and description |
---|---|---|
|
protected abstract WorkerAppExecutorFactory<P> |
createExecutorFactory() Create a worker app executor factory. |
|
protected abstract WorkerAppParameterFactory<P> |
createParameterFactory() Create a worker app parameter factory. |
|
public T |
entrypoint(Action<JvmEntryPoint> configurator) Configures the entrypoint for the JVM executable. |
|
public T |
entrypoint(groovy.lang.Closure<?> configurator) Configures the entrypoint for the JVM executable |
|
protected void |
exec() |
|
protected T |
getJvmExecSpec() |
|
protected ProjectOperations |
getProjectOperations() |
|
public T |
jvm(Action<JavaForkOptionsWithEnvProvider> configurator) Configures a JVM that will be forked. |
|
public T |
jvm(groovy.lang.Closure<?> configurator) Configures a JVM that will be forked. |
|
protected void |
preventExecutionMode(ExecutionMode mode, String reason) Prevents a specific execution mode from being set. |
|
public T |
process(Action<ProcessExecutionSpec> configurator) Configures the stream redirection and exit code checks. |
|
public T |
process(groovy.lang.Closure<?> configurator) Configures the stream redirections and exit checks. |
|
public T |
runnerSpec(Action<CmdlineArgumentSpec> configurator) Configures the arguments. |
|
public T |
runnerSpec(groovy.lang.Closure<?> configurator) Configures the arguments. |
|
public void |
setAwaitMode(Boolean mode) Set whether other tasks in this project should be blocked until this task's worker queue completed. |
|
protected void |
setExecSpec(T execSpec) |
|
public void |
setExecutionMode(ExecutionMode em) Sets the execution mode. |
Base class for executing tasks on the JVM.
we
- Can be null, in which case workers will not be supportedCreate a worker app executor factory.
Create a worker app parameter factory.
Configures the entrypoint for the JVM executable.
This includes the classpath, modularity and main class.
configurator
- An action to configure the entrypointConfigures the entrypoint for the JVM executable
configurator
- A closure to configure the entrypointConfigures a JVM that will be forked.
configurator
- An action to configure the JVM's fork options.Configures a JVM that will be forked.
configurator
- A closure to configure the JVM's fork options.Prevents a specific execution mode from being set.
mode
- Illegal execution modereason
- Reason why execution mode cannot be used.Configures the stream redirection and exit code checks.
This includes the inputs and output streams as well as the exit value.
configurator
- An action to configure the execution.Configures the stream redirections and exit checks.
configurator
- A closure to configure the execution.Configures the arguments.
configurator
- An action to configure the arguments.Configures the arguments.
configurator
- A closure to configure the arguments.Set whether other tasks in this project should be blocked until this task's worker queue completed.
Ignored if executionMode == JAVA_EXEC
.
mode
- true
is blocking is required.Sets the execution mode.
This allows for JVM tasks to be executed either on a worker queue inside the JVM using an isolated classpath,
ouside the JVM in a separate process, OR using a classic javaexec
.
If nothing is set, the default is ExecutionMode#JAVA_EXEC#JAVA_EXEC.
em
- Execution mode.