Class BaseExecutorMode
- java.lang.Object
-
- jetbrains.buildServer.agent.impl.operationModes.BaseExecutorMode
-
- All Implemented Interfaces:
AgentOperationMode
,AgentOperationModeEx
- Direct Known Subclasses:
ExecutorFinishMode
,ExecutorRunnerMode
,ExecutorStartMode
public abstract class BaseExecutorMode extends Object implements AgentOperationModeEx
An abstract parent class for a family of agent operation mode subclasses which collectively take care of executing all build stages during an Executor Mode build.ExecutorStartMode
executes all the BuildStages preceding the execution of all build stepsExecutorRunnerMode
executes all the actual build stepsExecutorFinishMode
executes all BuildFinishStages that must be conducted after the completion of the last build step- Since:
- 2023.09
- See Also:
BuildStage
,BuildFinishStage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.agent.AgentOperationModeEx
AgentOperationModeEx.StagesProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger
LOG
protected AgentBuild
myAgentBuild
protected AgentBuildSerializer
myAgentBuildSerializer
protected BuildAgentImpl
myBuildAgent
protected BuildStateCacheManager
myBuildStateCacheManager
-
Constructor Summary
Constructors Constructor Description BaseExecutorMode(BuildAgentImpl buildAgent, BuildCacheHolder buildCacheHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyBuildStateToAgent(BuildState buildState)
protected void
flushAgentLog()
boolean
isRegistrationOnServerSupported()
Returns true if the agent should register on the server.void
onAgentStart()
protected void
restorePasswords(BuildState buildState, AgentRunningBuild runningBuild)
protected void
setAgentBuild(AgentBuild agentBuild)
boolean
shouldCleanTempDirectories()
Determines whether temporary directories should be cleaned when the agent starts.protected void
shutdownAgent()
protected void
shutdownAgentWithError(boolean killBuild)
protected void
storeStepData(AgentRunningBuild build, BuildFinishedStatus status)
protected void
storeStepData(AgentRunningBuild build, BuildFinishedStatus status, int runnerToExecuteIndex, long buildCumulativeTime)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.agent.AgentOperationModeEx
beforeAgentStart, executeRunnerStages, onBuildFinish, onRunnersFinished
-
-
-
-
Field Detail
-
myBuildAgent
protected final BuildAgentImpl myBuildAgent
-
LOG
protected final Logger LOG
-
myBuildStateCacheManager
protected final BuildStateCacheManager myBuildStateCacheManager
-
myAgentBuildSerializer
protected final AgentBuildSerializer myAgentBuildSerializer
-
myAgentBuild
protected AgentBuild myAgentBuild
-
-
Constructor Detail
-
BaseExecutorMode
public BaseExecutorMode(@NotNull BuildAgentImpl buildAgent, @NotNull BuildCacheHolder buildCacheHolder)
-
-
Method Detail
-
isRegistrationOnServerSupported
public boolean isRegistrationOnServerSupported()
Description copied from interface:AgentOperationMode
Returns true if the agent should register on the server.- Specified by:
isRegistrationOnServerSupported
in interfaceAgentOperationMode
- Returns:
- see above
-
shouldCleanTempDirectories
public boolean shouldCleanTempDirectories()
Description copied from interface:AgentOperationModeEx
Determines whether temporary directories should be cleaned when the agent starts. This method is used to indicate if any temporary directories of the agent used during the execution should be cleaned on start-up.- Specified by:
shouldCleanTempDirectories
in interfaceAgentOperationModeEx
- Returns:
- true if the temporary directories should be cleaned up; false otherwise
-
flushAgentLog
protected void flushAgentLog()
-
shutdownAgent
protected void shutdownAgent()
-
setAgentBuild
protected void setAgentBuild(@NotNull AgentBuild agentBuild)
-
onAgentStart
public void onAgentStart() throws IllegalStateException
- Specified by:
onAgentStart
in interfaceAgentOperationModeEx
- Throws:
IllegalStateException
-
storeStepData
protected void storeStepData(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus status)
-
storeStepData
protected void storeStepData(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus status, int runnerToExecuteIndex, long buildCumulativeTime)
-
shutdownAgentWithError
protected void shutdownAgentWithError(boolean killBuild)
-
applyBuildStateToAgent
protected void applyBuildStateToAgent(@Nullable BuildState buildState) throws IllegalStateException
- Throws:
IllegalStateException
-
restorePasswords
protected void restorePasswords(BuildState buildState, AgentRunningBuild runningBuild)
-
-