Class FlowExecutionOwner
java.lang.Object
org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
- All Implemented Interfaces:
Serializable
We need something that's serializable in small moniker that helps us find THE instance
of
FlowExecution.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceMarker interface for queue executables fromgetExecutable(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FlowExecutionOwnerA placeholder implementation for use in compatibility stubs.abstract booleanFlowExecutionOwners are equal to one another if and only if they point to the sameFlowExecutionobject.abstract FlowExecutionget()abstract Queue.ExecutableThe executor slot running this flow, such as aRun.TheRun.getExternalizableId(), if this owner is indeed aRun.Gets a listener to which we may print general messages.Same asget()but avoids throwing an exception or blocking.abstract FileA directory (on the controller) where information may be persisted.abstract StringgetUrl()Returns the URL of the model object that ownsFlowExecution, relative to the context root of Jenkins.abstract inthashCode()Needs to be overridden as theequals(Object)method is overridden.
-
Constructor Details
-
FlowExecutionOwner
public FlowExecutionOwner()
-
-
Method Details
-
get
- Throws:
IOException- if fails to findFlowExecution.
-
getOrNull
Same asget()but avoids throwing an exception or blocking.- Returns:
- a valid flow execution, or null if not ready or invalid
-
getRootDir
A directory (on the controller) where information may be persisted.- Throws:
IOException- See Also:
-
getExecutable
The executor slot running this flow, such as aRun. The conceptual "owner" ofFlowExecution. (For anything that runs for a long enough time that demands flow, it better occupies an executor. So this type restriction should still enable scriptler to use this.)- Returns:
- preferably an
FlowExecutionOwner.Executable - Throws:
IOException
-
getUrl
Returns the URL of the model object that ownsFlowExecution, relative to the context root of Jenkins. This is usually not the same object as 'this'. This object must have thegetExecution()method to bindFlowExecutionto the URL space (or otherwise overridegetUrlOfExecution()).- Returns:
- String like "job/foo/32/" with trailing slash but no leading slash.
- Throws:
IOException
-
getUrlOfExecution
- Throws:
IOException
-
getExternalizableId
TheRun.getExternalizableId(), if this owner is indeed aRun. The default implementation usesgetExecutable()but an implementation may override this to avoid loading the actualRun.- Returns:
- an id, or null if unknown, unloadable, or unapplicable
-
equals
FlowExecutionOwners are equal to one another if and only if they point to the sameFlowExecutionobject. -
hashCode
public abstract int hashCode()Needs to be overridden as theequals(Object)method is overridden. -
getListener
Gets a listener to which we may print general messages. NormallyStepContext.get(java.lang.Class<T>)should be used, but in some cases there is no associated step.The listener should be remotable: if sent to an agent, messages printed to it should still appear in the log. The same will then apply to calls to
StepContext.get(java.lang.Class<T>)onTaskListener.- Throws:
IOException
-
dummyOwner
A placeholder implementation for use in compatibility stubs.
-