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.
|
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)
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.