Class DefaultTaskExecutionContext
java.lang.Object
com.xebialabs.xlrelease.domain.tasks.plugin.DefaultTaskExecutionContext
- All Implemented Interfaces:
com.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext,com.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
public class DefaultTaskExecutionContext
extends Object
implements com.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
The host's
TaskExecutionContext, backed by a PluginTask and its configuration.
Reads come straight from the configuration CI; writes are buffered rather than
applied to the CI. That is not an optimisation - the CI a worker holds is a detached copy, and the
only supported way to persist task changes is to hand results back through the release actor
(which ScriptResultsService then applies). Writing directly here would appear to work and
silently lose data.
Not thread-safe, and not intended to outlive one execute call.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTaskExecutionContext(com.xebialabs.xlrelease.domain.PluginTask task, boolean resume) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> getInputProperty(String name, Class<T> type) <T> Optional<T> getOutputProperty(String name, Class<T> type) booleanisResume()voidvoidsetOutputProperty(String name, Object value) voidsetStatusLine(String statusLine) Everything the extension wrote, ready to hand back through the release actor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
getInputProperty
-
Constructor Details
-
DefaultTaskExecutionContext
public DefaultTaskExecutionContext(com.xebialabs.xlrelease.domain.PluginTask task, boolean resume)
-
-
Method Details
-
getTaskId
- Specified by:
getTaskIdin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
getReleaseId
- Specified by:
getReleaseIdin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
getTaskType
- Specified by:
getTaskTypein interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
isResume
public boolean isResume()- Specified by:
isResumein interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
-
getInputProperty
- Specified by:
getInputPropertyin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
getInputProperties
- Specified by:
getInputPropertiesin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
setOutputProperty
- Specified by:
setOutputPropertyin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
-
getOutputProperty
- Specified by:
getOutputPropertyin interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext
-
log
- Specified by:
login interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
-
setStatusLine
- Specified by:
setStatusLinein interfacecom.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionContext
-
toResults
Everything the extension wrote, ready to hand back through the release actor.- Parameters:
resumeDelaySeconds- from asuspendForoutcome, elsenullawaitSignal- true for anawaitSignaloutcome
-
getExecutionLog
-