Interface TaskAbortContext
- All Known Subinterfaces:
TaskExecutionContext
public interface TaskAbortContext
The read-only view of a task that
TaskExecutorExtension.onAbort(com.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext) receives — everything an
extension may need to release external resources (correlation ids it stored in output
properties, connection details from input properties), and nothing it could mutate: the task is
already failed by the time this is called, so writes would have nowhere to go.
TaskExecutionContext extends this interface, so the read methods behave identically
during execution and during abort notification.
-
Method Summary
Modifier and TypeMethodDescriptionAll declared input properties by name.getInputProperty(String name) Convenience for the common case of a text input.<T> Optional<T> getInputProperty(String name, Class<T> type) An input property declared on the task's configuration type, converted totype.<T> Optional<T> getOutputProperty(String name, Class<T> type) Reads an output property — typically correlation state the extension itself wrote before suspending.The id of the release the task belongs to.The id of the task — useful for logging and for correlating with an external system.The name of the configuration type of this task, inprefix.Nameform.
-
Method Details
-
getTaskId
String getTaskId()The id of the task — useful for logging and for correlating with an external system. -
getReleaseId
String getReleaseId()The id of the release the task belongs to. -
getTaskType
String getTaskType()The name of the configuration type of this task, inprefix.Nameform. -
getInputProperty
An input property declared on the task's configuration type, converted totype.- Throws:
IllegalArgumentException- if no such property is declared on this typeClassCastException- if the declared property cannot be viewed astype
-
getInputProperty
Convenience for the common case of a text input. -
getInputProperties
All declared input properties by name. Unset properties are absent rather thannull-valued. The returned map is a snapshot and is immutable. -
getOutputProperty
Reads an output property — typically correlation state the extension itself wrote before suspending.- Throws:
IllegalArgumentException- if no such property is declared on this type
-