public interface TaskLauncher
TaskLauncher
is merely a runtime representation of a container or application wherein the
task should be executed.
The SPI itself doesn't expect the launcher to keep state of launched tasks,
meaning it doesn't need to reconstruct all existing TaskStatus
es or
the IDs needed to resolve a TaskStatus
. The responsibility for
keeping track of the state of all existing tasks lies to whomever is using
this SPI. It is unrealistic to expect the launcher to be able to store enough
information using the underlying infrastructure to reconstruct the full
history of task executions.Modifier and Type | Method and Description |
---|---|
void |
cancel(String id)
Cancel the task corresponding to the provided id.
|
void |
cleanup(String id)
Attempt to clean up any app execution resources that are associated with a task launch represented by the
provided task execution id.
|
void |
destroy(String appName)
Attempt to clean up any app resources that are associated with a task app represented by the provided
appName.
|
RuntimeEnvironmentInfo |
environmentInfo()
Return the environment info for this launcher/deployer.
|
String |
launch(AppDeploymentRequest request)
Launch a task for the provided
AppDeploymentRequest . |
TaskStatus |
status(String id)
Returns the
TaskStatus for a task represented by the provided id. |
String launch(AppDeploymentRequest request)
AppDeploymentRequest
. The returned
id may later be used with cancel(String)
or
status(String)
to cancel a task or get its status,
respectively.
Implementations may perform this operation asynchronously; therefore a
successful launch may not be assumed upon return. To determine the status
of a launch, invoke status(String)
.request
- the task launch requestvoid cancel(String id)
status(String)
.id
- the task id, as returned by launch(AppDeploymentRequest)
TaskStatus status(String id)
TaskStatus
for a task represented by the provided id.id
- the task id, as returned by launch(AppDeploymentRequest)
void cleanup(String id)
id
- the task id, as returned by launch(AppDeploymentRequest)
void destroy(String appName)
appName
- the app name as specified in AppDefinition.name
from the launch(AppDeploymentRequest)
RuntimeEnvironmentInfo environmentInfo()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.