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.ExecutorStartModeexecutes all the BuildStages preceding the execution of all build stepsExecutorRunnerModeexecutes all the actual build stepsExecutorFinishModeexecutes 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 LoggerLOGprotected AgentBuildmyAgentBuildprotected AgentBuildSerializermyAgentBuildSerializerprotected BuildAgentImplmyBuildAgentprotected BuildStateCacheManagermyBuildStateCacheManager
-
Constructor Summary
Constructors Constructor Description BaseExecutorMode(BuildAgentImpl buildAgent, BuildCacheHolder buildCacheHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyBuildStateToAgent(BuildState buildState)protected voidflushAgentLog()booleanisRegistrationOnServerSupported()Returns true if the agent should register on the server.voidonAgentStart()protected voidrestorePasswords(BuildState buildState, AgentRunningBuild runningBuild)protected voidsetAgentBuild(AgentBuild agentBuild)booleanshouldCleanTempDirectories()Determines whether temporary directories should be cleaned when the agent starts.protected voidshutdownAgent()protected voidshutdownAgentWithError(boolean killBuild)protected voidstoreStepData(AgentRunningBuild build, BuildFinishedStatus status)protected voidstoreStepData(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:AgentOperationModeReturns true if the agent should register on the server.- Specified by:
isRegistrationOnServerSupportedin interfaceAgentOperationMode- Returns:
- see above
-
shouldCleanTempDirectories
public boolean shouldCleanTempDirectories()
Description copied from interface:AgentOperationModeExDetermines 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:
shouldCleanTempDirectoriesin 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:
onAgentStartin 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)
-
-