Package rife.bld.operations
Class AbstractProcessOperation<T extends AbstractProcessOperation<T>>
java.lang.Object
rife.bld.operations.AbstractOperation<T>
rife.bld.operations.AbstractProcessOperation<T>
- Direct Known Subclasses:
RunOperation
,TestOperation
public abstract class AbstractProcessOperation<T extends AbstractProcessOperation<T>>
extends AbstractOperation<T>
Abstract operation that starts a Java application as a separate process.
- Since:
- 1.5.18
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the classpath to use for the operation.Provides classpath entries to use for the operation.Provides a list of classpath entries to use for the operation.Retrieves the processor that is used to handle the process errors.errorProcessor
(Function<String, Boolean> processor) Provides the processor that will be used to handle the process errors.void
execute()
Performs the operation.Part of theexecute()
operation, constructs the command list to use for building the process.protected Process
Part of theexecute()
operation, starts the process.abstract T
fromProject
(BaseProject project) Configures the operation from aBaseProject
.Retrieves the options to provide to the java tool.javaOptions
(List<String> options) Provides the options to provide to the java tool.javaTool()
retrieves the name of the tool to use forjava
execution.Provides the name of the tool to use forjava
execution.Retrieves the main class to launch with the java tool.Provides the main class to launch with the java tool.Retrieves the processor that is used to handle the process output.outputProcessor
(Function<String, Boolean> processor) Provides the processor that will be used to handle the process output.process()
Retrieves the process that was used for the execution.Retrieves the work directory in which the operation will be performed.workDirectory
(File directory) Provides the work directory in which the operation will be performed.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent
-
Field Details
-
DEFAULT_JAVA_TOOL
- See Also:
-
workDirectory_
-
javaTool_
-
javaOptions_
-
classpath_
-
mainClass_
-
outputProcessor_
-
errorProcessor_
-
process_
-
successful_
protected boolean successful_ -
outputProcessorThread_
-
errorProcessorThread_
-
-
Constructor Details
-
AbstractProcessOperation
public AbstractProcessOperation()
-
-
Method Details
-
execute
public void execute() throws IOException, FileUtilsErrorException, InterruptedException, ExitStatusExceptionPerforms the operation.- Specified by:
execute
in classAbstractOperation<T extends AbstractProcessOperation<T>>
- Throws:
InterruptedException
- when the operation was interruptedIOException
- when an exception occurred during the execution of the processFileUtilsErrorException
- when an exception occurred during the retrieval of the operation outputExitStatusException
- when the exit status was changed during the operation- Since:
- 1.5
-
executeConstructProcessCommandList
Part of theexecute()
operation, constructs the command list to use for building the process.- Since:
- 1.5
-
executeStartProcess
Part of theexecute()
operation, starts the process.- Throws:
IOException
- Since:
- 1.5
-
fromProject
Configures the operation from aBaseProject
.- Parameters:
project
- the project to configure the operation from- Since:
- 1.5
-
workDirectory
Provides the work directory in which the operation will be performed.If no work directory is provided, the JVM working directory will be used.
- Parameters:
directory
- the directory to use as a work directory- Returns:
- this operation instance
- Since:
- 1.5
-
javaTool
Provides the name of the tool to use forjava
execution.If no java tool is provided
java
will be used.- Parameters:
tool
- the name of the java tool- Returns:
- this operation instance
- Since:
- 1.5
-
javaOptions
Provides the options to provide to the java tool.- Parameters:
options
- the java tool's options- Returns:
- this operation instance
- Since:
- 1.5
-
classpath
Provides classpath entries to use for the operation.- Parameters:
classpath
- classpath entries for the operation- Returns:
- this operation instance
- Since:
- 1.5.18
-
classpath
Provides a list of classpath entries to use for the operation.A copy will be created to allow this list to be independently modifiable.
- Parameters:
classpath
- a list of classpath entries for the operation- Returns:
- this operation instance
- Since:
- 1.5
-
mainClass
Provides the main class to launch with the java tool.- Parameters:
name
- the main class to launch- Returns:
- this operation instance
- Since:
- 1.5
-
outputProcessor
Provides the processor that will be used to handle the process output.It will be called for each line in the output.
- Parameters:
processor
- the output processor- Returns:
- this operation instance
- Since:
- 1.5.1
-
errorProcessor
Provides the processor that will be used to handle the process errors.It will be called for each line in the error output.
- Parameters:
processor
- the error processor- Returns:
- this operation instance
- Since:
- 1.5.1
-
workDirectory
Retrieves the work directory in which the operation will be performed.- Returns:
- the directory to use as a work directory
- Since:
- 1.5
-
javaTool
retrieves the name of the tool to use forjava
execution.- Returns:
- the name of the java tool
- Since:
- 1.5
-
javaOptions
Retrieves the options to provide to the java tool.This is a modifiable list that can be retrieved and changed.
- Returns:
- the java tool's options
- Since:
- 1.5
-
classpath
Retrieves the classpath to use for the operation.This is a modifiable list that can be retrieved and changed.
- Returns:
- the operation's classpath
- Since:
- 1.5
-
mainClass
Retrieves the main class to launch with the java tool.- Returns:
- the main class to launch
- Since:
- 1.5
-
outputProcessor
Retrieves the processor that is used to handle the process output.- Returns:
- the output processor
- Since:
- 1.5.1
-
errorProcessor
Retrieves the processor that is used to handle the process errors.- Returns:
- the error processor
- Since:
- 1.5.1
-
process
Retrieves the process that was used for the execution.- Returns:
- the process that was executed
- Since:
- 1.5
-