Class DeclarativeAgent<A extends DeclarativeAgent<A>>
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<T>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescribable<A>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent<A>
-
- All Implemented Interfaces:
ExtensionPoint,Describable<A>,Serializable
public abstract class DeclarativeAgent<A extends DeclarativeAgent<A>> extends WithScriptDescribable<A> implements ExtensionPoint
Implementations forDeclarativeAgentDescriptor- pluggable agent backends for Declarative Pipelines.- Author:
- Andrew Bayer
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandoCheckoutprotected booleaninStageprotected Stringsubdirectory
-
Constructor Summary
Constructors Constructor Description DeclarativeAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFlags(DeclarativeAgent a)DeclarativeAgentDescriptorgetDescriptor()WithScriptScriptgetScript(org.jenkinsci.plugins.workflow.cps.CpsScript cpsScript)ONLY TO BE RUN FROM WITHIN A CPS THREAD.StringgetSubdirectory()booleanhasScmContext(org.jenkinsci.plugins.workflow.cps.CpsScript script)voidinitialize(Map<String,DeclarativeOption> options, boolean explicitAgentInStage)booleanisDoCheckout()booleanisInStage()booleanreuseRootAgent(Map<String,DeclarativeOption> options)voidsetDoCheckout(boolean doCheckout)voidsetInStage(boolean inStage)voidsetSubdirectory(String subdirectory)
-
-
-
Field Detail
-
inStage
protected boolean inStage
-
doCheckout
protected boolean doCheckout
-
subdirectory
protected String subdirectory
-
-
Method Detail
-
getScript
public WithScriptScript getScript(org.jenkinsci.plugins.workflow.cps.CpsScript cpsScript) throws Exception
Description copied from class:WithScriptDescribableONLY TO BE RUN FROM WITHIN A CPS THREAD. Parses the script source and loads it. TODO: Decide if we want to cache the resulting objects or just *shrug* and re-parse them every time.- Overrides:
getScriptin classWithScriptDescribable<A extends DeclarativeAgent<A>>- Returns:
- The script object for this.
- Throws:
Exception- if the script source cannot be loaded or we're called from outside a CpsThread.
-
setInStage
public void setInStage(boolean inStage)
-
isInStage
public boolean isInStage()
-
initialize
public void initialize(Map<String,DeclarativeOption> options, boolean explicitAgentInStage)
-
reuseRootAgent
public boolean reuseRootAgent(Map<String,DeclarativeOption> options)
-
setDoCheckout
public void setDoCheckout(boolean doCheckout)
-
isDoCheckout
public boolean isDoCheckout()
-
setSubdirectory
public void setSubdirectory(String subdirectory)
-
getSubdirectory
public String getSubdirectory()
-
copyFlags
public void copyFlags(@NonNull DeclarativeAgent a)
-
hasScmContext
public boolean hasScmContext(org.jenkinsci.plugins.workflow.cps.CpsScript script)
-
getDescriptor
public DeclarativeAgentDescriptor getDescriptor()
- Specified by:
getDescriptorin interfaceDescribable<A extends DeclarativeAgent<A>>- Overrides:
getDescriptorin classWithScriptDescribable<A extends DeclarativeAgent<A>>
-
-