public interface TargetEnvironmentFactory
TargetEnvironment
) for given
target configuration (TargetEnvironmentConfiguration
.
A factory of a particular TargetEnvironmentType
can be obtained
with TargetEnvironmentType#createEnvironmentFactory(Project, TargetEnvironmentConfiguration)
method.
As a shortcut for retrieving factory of environment with particular configuration TargetEnvironmentConfiguration#createEnvironmentFactory(Project)
can be used
The creating of an environment happens in two phases:
1. first, environment request should be created and fulfilled – this#createRequest()
;
2. then fulfilled request should be used for preparing target environment.
Usually, the client will look like this:
val factory = config.createEnvironmentFactory(project)
val request = factory.createRequest()
val commandLine = new TargetedCommandLine()
commandLine.setExePath("/bin/cat")
commandLine.addParameter(request.createUpload("/tmp/localInputFile.txt"))
factory.prepareRemoteEnvironment(request, progressIndicator).createProcess(commandLine, progressIndicator)
See the implementation for local machine: LocalTargetEnvironmentFactory
Modifier and Type | Method and Description |
---|---|
TargetEnvironmentRequest |
createRequest() |
TargetEnvironmentConfiguration |
getTargetConfiguration() |
TargetPlatform |
getTargetPlatform() |
TargetEnvironment |
prepareRemoteEnvironment(TargetEnvironmentRequest request,
ProgressIndicator indicator)
Prepares the actual environment.
|
TargetEnvironmentConfiguration getTargetConfiguration()
TargetPlatform getTargetPlatform()
TargetEnvironmentRequest createRequest()
TargetEnvironment prepareRemoteEnvironment(TargetEnvironmentRequest request, ProgressIndicator indicator)
ProgressIndicator