Class YamlProcess
java.lang.Object
de.iip_ecosphere.platform.services.environment.YamlProcess
- All Implemented Interfaces:
ProcessSpec
- Direct Known Subclasses:
YamlServer
If the service is not completely implemented rather than delegates functionality to an additional process that
must be started and managed along with the service.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the process implementing artifacts within the containing artifact to be extracted into theprocess home directory.Returns the command line arguments to start the process.Returns the arguments to be passed to the executable itself.Returns the system command or relative path within the artifact to be executed.Returns an optional path to be prefixed before the executable.Returns the home directory of the process to be executed.Returns the location key for lookup inInstalledDependenciesSetup.ReturnsgetCmdArg()with substitutions fromtoSubstFileName(String)for all arguments.booleanReturns whether the underlying process is already started when firing up the service or it will be started through the service implementation.voidsetArtifacts(List<String> artifacts) Defines the process implementing artifacts within the containing artifact to be extracted.voidDefines the command line arguments.voidsetExecArg(List<String> execArg) Defines the arguments to be passed to the executable itself.voidsetExecutable(String executable) Defines the system command or relative path to be executed.voidsetExecutablePath(File executablePath) Changes the optional path to be prefixed before the executable.voidsetExecutablePath(String executablePath) Changes the optional path to be prefixed before the executable.voidsetHomePath(File home) Changes the home directory of the process to be executed.voidsetHomePath(String homePath) Changes the home directory of the process to be executed.voidsetLocationKey(String locationKey) Changes the location key for lookup inInstalledDependenciesSetup.voidsetStarted(boolean started) Changes whether the underlying process is already started when firing up the service.protected static StringtoSubstFileName(String path) Substitutes "${tmp}" and "${user}" and returns a name forpath.protected static FiletoSubstFilePath(String path) Substitutes "${tmp}" and "${user}" and returns a file forpath.
-
Field Details
-
executable
-
executablePath
-
homePath
-
locationKey
-
execArg
-
cmdArg
-
artifacts
-
started
private boolean started
-
-
Constructor Details
-
YamlProcess
public YamlProcess()
-
-
Method Details
-
getArtifacts
Description copied from interface:ProcessSpecReturns the process implementing artifacts within the containing artifact to be extracted into theprocess home directory.- Specified by:
getArtifactsin interfaceProcessSpec- Returns:
- the relative paths to the artifacts, shall start with "/" as part of ZIP/JAR
-
isStarted
public boolean isStarted()Description copied from interface:ProcessSpecReturns whether the underlying process is already started when firing up the service or it will be started through the service implementation. If specified,artifactswill be extracted anyway into theprocess home directory, assuming that a pre-installed executable will not specify artifacts to be extracted.- Specified by:
isStartedin interfaceProcessSpec- Returns:
truefor started,falseelse (default)
-
setArtifacts
Defines the process implementing artifacts within the containing artifact to be extracted.- Parameters:
artifacts- the relative paths to the artifacts
-
setStarted
public void setStarted(boolean started) Changes whether the underlying process is already started when firing up the service. [required by SnakeYaml]- Parameters:
started-truefor started (default),falseelse
-
getExecutable
Description copied from interface:ProcessSpecReturns the system command or relative path within the artifact to be executed.- Specified by:
getExecutablein interfaceProcessSpec- Returns:
- the command or relative path
-
getLocationKey
Returns the location key for lookup inInstalledDependenciesSetup.- Returns:
- the location key, may be null
-
getExecutablePath
Description copied from interface:ProcessSpecReturns an optional path to be prefixed before the executable. Relevance depends on the execution environment.- Specified by:
getExecutablePathin interfaceProcessSpec- Returns:
- the optional executable path, may be null for none
-
getHomePath
Description copied from interface:ProcessSpecReturns the home directory of the process to be executed.- Specified by:
getHomePathin interfaceProcessSpec- Returns:
- the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
-
toSubstFileName
Substitutes "${tmp}" and "${user}" and returns a name forpath.- Parameters:
path- the path- Returns:
- the name, may be null if
pathis null or empty
-
toSubstFilePath
Substitutes "${tmp}" and "${user}" and returns a file forpath.- Parameters:
path- the path- Returns:
- the file, may be null if
pathis null or empty
-
getCmdArg
Description copied from interface:ProcessSpecReturns the command line arguments to start the process. The shell will be executed within the folder where the files fromProcessSpec.getHomePath()are extracted.- Specified by:
getCmdArgin interfaceProcessSpec- Returns:
- the command line arguments (may be empty for none)
-
getExecArg
Description copied from interface:ProcessSpecReturns the arguments to be passed to the executable itself. Executable args and command line args may be the same in many cases, but also may differ for Java (-D arguments) or Python/Conda (conda arguments).- Specified by:
getExecArgin interfaceProcessSpec- Returns:
- the command line executable arguments (may be empty for none)
-
getSubstCmdArg
ReturnsgetCmdArg()with substitutions fromtoSubstFileName(String)for all arguments.- Returns:
- the substitutions
-
setExecutable
Defines the system command or relative path to be executed. [required by SnakeYaml]- Parameters:
executable- the name/path
-
setLocationKey
Changes the location key for lookup inInstalledDependenciesSetup.- Parameters:
locationKey- the location key, may be null
-
setExecutablePath
Changes the optional path to be prefixed before the executable. Relevance depends on the execution environment. May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path. [required by SnakeYaml]- Parameters:
executablePath- the optional executable path, may be null for none
-
setExecutablePath
Changes the optional path to be prefixed before the executable. Relevance depends on the execution environment. May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path. [required by SnakeYaml]- Parameters:
executablePath- the optional executable path, may be null for none
-
setHomePath
Changes the home directory of the process to be executed. [required by SnakeYaml] May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path.- Parameters:
homePath- the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
-
setHomePath
Changes the home directory of the process to be executed. [required by SnakeYaml] May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path.- Parameters:
home- the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
-
setExecArg
Defines the arguments to be passed to the executable itself. [required by SnakeYaml] Executable args and command line args may be the same in many cases, but also may differ for Java (-D arguments) or Python/Conda (conda arguments).- Parameters:
execArg- the command line executable arguments (may be empty for none)
-
setCmdArg
Defines the command line arguments. [required by SnakeYaml]- Parameters:
cmdArg- the command line arguments (may be empty for none)
-