Package jetbrains.buildServer.agent
Class AgentLifeCycleAdapter
- java.lang.Object
-
- jetbrains.buildServer.agent.AgentLifeCycleAdapter
-
- All Implemented Interfaces:
EventListener,AgentLifeCycleListener
- Direct Known Subclasses:
AgentBuildStepStatusFixer,AgentServiceMessagesRegisterImpl,ArtifactPostBuildCleaner,BuildCacheHolder,BuildMessagesPasswordTranslator,BuildStageStatisticsReporter,CheckoutDirectoryStructurePublisher,CurrentBuildTrackerImpl,DirectoryMapWatcher,HostnameParameterProvider,SslAgentLifeCycleAdapter,WatchDogServiceMessageHandler
public class AgentLifeCycleAdapter extends Object implements AgentLifeCycleListener
Base class for agent listeners
-
-
Constructor Summary
Constructors Constructor Description AgentLifeCycleAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterAgentConfigurationLoaded(BuildAgent agent)is called after build agent loaded it's properties and it is called beforeAgentLifeCycleListener.agentInitialized(BuildAgent)This is a right place to update loaded environment and set agent-wide properties usingBuildAgentConfigurationinterfacevoidafterAtrifactsPublished(AgentRunningBuild runningBuild, BuildFinishedStatus status)Called when all artifacts were published to the servervoidagentInitialized(BuildAgent agent)Called when methodBuildAgent.init(String[])finishedvoidagentShutdown()Called before agent shutdownvoidagentStarted(BuildAgent agent)Called after the agentBuildAgent.start()methodvoidbeforeAgentConfigurationLoaded(BuildAgent agent)is called before build agent loaded it's properties and it is called beforeAgentLifeCycleListener.agentInitialized(BuildAgent)This is a right place to detect environment and set agent-wide properties usingBuildAgentConfigurationinterfacevoidbeforeBuildFinish(AgentRunningBuild build, BuildFinishedStatus buildStatus)Called after finishing build but before buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild)orAgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)voidbeforeBuildFinish(BuildFinishedStatus buildStatus)Deprecated.voidbeforeBuildInterrupted(AgentRunningBuild runningBuild, BuildInterruptReason reason)Called before build is forcibly terminated, can be called several times if more than one attempt to terminate build is performed.voidbeforeRunnerStart(AgentRunningBuild runningBuild)Deprecated.voidbeforeRunnerStart(BuildRunnerContext runner)Called when the build preparation phase is done (sources are gotten, patch is applied, etc.) a runner is about to be launched.voidbuildFinished(AgentRunningBuild build, BuildFinishedStatus buildStatus)Called after the buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus)New build may be started while processing this eventvoidbuildFinished(BuildFinishedStatus buildStatus)Deprecated.voidbuildStarted(AgentRunningBuild runningBuild)Called after agent receives start build command from the server.voidcheckoutDirectoryRemoved(File checkoutDir)Called when a build checkout directory was removed from build agent 'work' directory.voidcheckoutModeResolved(AgentCheckoutMode agentCheckoutMode)Called when effective checkout mode is resolved for the build.voiddependenciesDownloaded(AgentRunningBuild runningBuild)Called when dependencies for the build have been resolved and downloaded successfullyvoidmessageLogged(AgentRunningBuild build, BuildMessage1 buildMessage)Called when a build message loggedvoidmessageLogged(BuildMessage1 buildMessage)Called when a build message logged SeeAgentLifeCycleListener.messageLogged(AgentRunningBuild, jetbrains.buildServer.messages.BuildMessage1)voidpersonalPatchApplied(AgentRunningBuild runningBuild)Called when personal patch is applied to checkout directory.voidpersonalPatchReverted(AgentRunningBuild runningBuild)Called when personal patch is reverted Will not be called if build is not personalvoidpluginsLoaded()Called after plugin manager has loaded all plugins.voidpreparationFinished(AgentRunningBuild runningBuild)Called when all preparations for the build are finished (sources checkout, personal patch, artifact dependencies, free disk space requirement, etc), and build is ready to execute it's steps, if there are any.voidrunnerFinished(BuildRunnerContext runner, BuildFinishedStatus status)voidsourcesUpdated(AgentRunningBuild runningBuild)Called when non personal changes are applied to checkout directory.
-
-
-
Method Detail
-
beforeAgentConfigurationLoaded
public void beforeAgentConfigurationLoaded(@NotNull BuildAgent agent)Description copied from interface:AgentLifeCycleListeneris called before build agent loaded it's properties and it is called beforeAgentLifeCycleListener.agentInitialized(BuildAgent)This is a right place to detect environment and set agent-wide properties usingBuildAgentConfigurationinterface- Specified by:
beforeAgentConfigurationLoadedin interfaceAgentLifeCycleListener- Parameters:
agent- agent
-
afterAgentConfigurationLoaded
public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent)Description copied from interface:AgentLifeCycleListeneris called after build agent loaded it's properties and it is called beforeAgentLifeCycleListener.agentInitialized(BuildAgent)This is a right place to update loaded environment and set agent-wide properties usingBuildAgentConfigurationinterface- Specified by:
afterAgentConfigurationLoadedin interfaceAgentLifeCycleListener- Parameters:
agent- agent
-
pluginsLoaded
public void pluginsLoaded()
Description copied from interface:AgentLifeCycleListenerCalled after plugin manager has loaded all plugins.- Specified by:
pluginsLoadedin interfaceAgentLifeCycleListener
-
agentInitialized
public void agentInitialized(@NotNull BuildAgent agent)Description copied from interface:AgentLifeCycleListenerCalled when methodBuildAgent.init(String[])finished- Specified by:
agentInitializedin interfaceAgentLifeCycleListener- Parameters:
agent- build agent
-
agentStarted
public void agentStarted(@NotNull BuildAgent agent)Description copied from interface:AgentLifeCycleListenerCalled after the agentBuildAgent.start()method- Specified by:
agentStartedin interfaceAgentLifeCycleListener- Parameters:
agent- build agent
-
agentShutdown
public void agentShutdown()
Description copied from interface:AgentLifeCycleListenerCalled before agent shutdown- Specified by:
agentShutdownin interfaceAgentLifeCycleListener
-
buildStarted
public void buildStarted(@NotNull AgentRunningBuild runningBuild)Description copied from interface:AgentLifeCycleListenerCalled after agent receives start build command from the server. To register custom build parameters provideAgentPropertiesExtensionagent extension. Note, methods from that interface are called before that method.- Specified by:
buildStartedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- information about running build
-
checkoutModeResolved
public void checkoutModeResolved(@NotNull AgentCheckoutMode agentCheckoutMode)Description copied from interface:AgentLifeCycleListenerCalled when effective checkout mode is resolved for the build. It's guaranteed that after this event,AgentRunningBuild.getEffectiveCheckoutMode()will return non-null value.- Specified by:
checkoutModeResolvedin interfaceAgentLifeCycleListener
-
sourcesUpdated
public void sourcesUpdated(@NotNull AgentRunningBuild runningBuild)Description copied from interface:AgentLifeCycleListenerCalled when non personal changes are applied to checkout directory. Called afterAgentLifeCycleListener.buildStarted(AgentRunningBuild)called. Will not be called if checkout mode is set to manual.- Specified by:
sourcesUpdatedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- current running build
-
personalPatchApplied
public void personalPatchApplied(@NotNull AgentRunningBuild runningBuild)Description copied from interface:AgentLifeCycleListenerCalled when personal patch is applied to checkout directory. Will not be called if build is not personal- Specified by:
personalPatchAppliedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- current running build
-
preparationFinished
public void preparationFinished(@NotNull AgentRunningBuild runningBuild)Called when all preparations for the build are finished (sources checkout, personal patch, artifact dependencies, free disk space requirement, etc), and build is ready to execute it's steps, if there are any.- Specified by:
preparationFinishedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- currently running build- Since:
- 10.0
- See Also:
AgentLifeCycleListener.preparationFinished(AgentRunningBuild)
-
beforeRunnerStart
@Deprecated public void beforeRunnerStart(@NotNull AgentRunningBuild runningBuild)
Deprecated.Description copied from interface:AgentLifeCycleListenerCalled when the build preparation phase is done (sources are gotten, patch is applied, etc.) the runner is about to be launched. Is called afterAgentLifeCycleListener.buildStarted(AgentRunningBuild)- Specified by:
beforeRunnerStartin interfaceAgentLifeCycleListener- Parameters:
runningBuild- running build
-
beforeRunnerStart
public void beforeRunnerStart(@NotNull BuildRunnerContext runner)Description copied from interface:AgentLifeCycleListenerCalled when the build preparation phase is done (sources are gotten, patch is applied, etc.) a runner is about to be launched. Is called at least afterAgentLifeCycleListener.buildStarted(AgentRunningBuild),AgentLifeCycleListener.sourcesUpdated(AgentRunningBuild),AgentLifeCycleListener.personalPatchApplied(AgentRunningBuild)- Specified by:
beforeRunnerStartin interfaceAgentLifeCycleListener- Parameters:
runner- current runner context parameters
-
runnerFinished
public void runnerFinished(@NotNull BuildRunnerContext runner, @NotNull BuildFinishedStatus status)Description copied from interface:AgentLifeCycleListenerCalled afterAgentLifeCycleListener.beforeRunnerStart(BuildRunnerContext). This notification is sent when build runner has finished, crashed or was interrupted.- Specified by:
runnerFinishedin interfaceAgentLifeCycleListener- Parameters:
runner- current runner context parametersstatus- status of process run
-
beforeBuildInterrupted
public void beforeBuildInterrupted(@NotNull AgentRunningBuild runningBuild, @NotNull BuildInterruptReason reason)Description copied from interface:AgentLifeCycleListenerCalled before build is forcibly terminated, can be called several times if more than one attempt to terminate build is performed. For example:- build execution time limit is exceeded
- build was stopped from server web UI
- Specified by:
beforeBuildInterruptedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- running buildreason- reason of build interruption
-
beforeBuildFinish
@Deprecated public void beforeBuildFinish(@NotNull BuildFinishedStatus buildStatus)
Deprecated.Description copied from interface:AgentLifeCycleListenerCalled after finishing build but before buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild)orAgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)- Specified by:
beforeBuildFinishin interfaceAgentLifeCycleListener- Parameters:
buildStatus- status of the build
-
beforeBuildFinish
public void beforeBuildFinish(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus buildStatus)Description copied from interface:AgentLifeCycleListenerCalled after finishing build but before buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild)orAgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)- Specified by:
beforeBuildFinishin interfaceAgentLifeCycleListener- Parameters:
build- buildbuildStatus- status of the build
-
personalPatchReverted
public void personalPatchReverted(@NotNull AgentRunningBuild runningBuild)Description copied from interface:AgentLifeCycleListenerCalled when personal patch is reverted Will not be called if build is not personal- Specified by:
personalPatchRevertedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- current running build
-
afterAtrifactsPublished
public void afterAtrifactsPublished(@NotNull AgentRunningBuild runningBuild, @NotNull BuildFinishedStatus status)Description copied from interface:AgentLifeCycleListenerCalled when all artifacts were published to the server- Specified by:
afterAtrifactsPublishedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- current running buildstatus- build status
-
buildFinished
@Deprecated public void buildFinished(@NotNull BuildFinishedStatus buildStatus)
Deprecated.Description copied from interface:AgentLifeCycleListenerCalled after the buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus)New build may be started while processing this event- Specified by:
buildFinishedin interfaceAgentLifeCycleListener- Parameters:
buildStatus- status of the build
-
buildFinished
public void buildFinished(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus buildStatus)Description copied from interface:AgentLifeCycleListenerCalled after the buildFinished event is sent to the server Is called afterAgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus)New build may be started while processing this event- Specified by:
buildFinishedin interfaceAgentLifeCycleListener- Parameters:
build- buildbuildStatus- status of the build
-
messageLogged
public void messageLogged(@NotNull BuildMessage1 buildMessage)Description copied from interface:AgentLifeCycleListenerCalled when a build message logged SeeAgentLifeCycleListener.messageLogged(AgentRunningBuild, jetbrains.buildServer.messages.BuildMessage1)- Specified by:
messageLoggedin interfaceAgentLifeCycleListener- Parameters:
buildMessage- build message
-
messageLogged
public void messageLogged(@NotNull AgentRunningBuild build, @NotNull BuildMessage1 buildMessage)Description copied from interface:AgentLifeCycleListenerCalled when a build message logged- Specified by:
messageLoggedin interfaceAgentLifeCycleListener- Parameters:
build- build that received this messagebuildMessage- build message
-
checkoutDirectoryRemoved
public void checkoutDirectoryRemoved(@NotNull File checkoutDir)Description copied from interface:AgentLifeCycleListenerCalled when a build checkout directory was removed from build agent 'work' directory. This can be called when build agent has cleaned up a build checkout directory because it was not used for a long period of time. Checkout directory may not be fully cleaned because of IO errors.- Specified by:
checkoutDirectoryRemovedin interfaceAgentLifeCycleListener- Parameters:
checkoutDir- path of the directory. This directory may not exist at the moment of the call.
-
dependenciesDownloaded
public void dependenciesDownloaded(@NotNull AgentRunningBuild runningBuild)Called when dependencies for the build have been resolved and downloaded successfully- Specified by:
dependenciesDownloadedin interfaceAgentLifeCycleListener- Parameters:
runningBuild- current running build- Since:
- 10.0
- See Also:
AgentLifeCycleListener.dependenciesDownloaded(AgentRunningBuild)
-
-