jetbrains.buildServer.agent
Class AgentLifeCycleAdapter

java.lang.Object
  extended by jetbrains.buildServer.agent.AgentLifeCycleAdapter
All Implemented Interfaces:
java.util.EventListener, AgentLifeCycleListener

public class AgentLifeCycleAdapter
extends java.lang.Object
implements AgentLifeCycleListener

Base class for agent listeners


Constructor Summary
AgentLifeCycleAdapter()
           
 
Method Summary
 void afterAgentConfigurationLoaded(BuildAgent agent)
          is called after build agent loaded it's properties and it is called before AgentLifeCycleListener.agentInitialized(BuildAgent) This is a right place to update loaded environment and set agent-wide properties using BuildAgentConfiguration interface
 void afterAtrifactsPublished(AgentRunningBuild runningBuild, BuildFinishedStatus status)
          Called when all artifacts were published to the server
 void agentInitialized(BuildAgent agent)
          Called when method BuildAgent.init(String[]) finished
 void agentShutdown()
          Called before agent shutdown
 void agentStarted(BuildAgent agent)
          Called after the agent BuildAgent.start() method Agent XML-RPC server is started.
 void beforeAgentConfigurationLoaded(BuildAgent agent)
          is called before build agent loaded it's properties and it is called before AgentLifeCycleListener.agentInitialized(BuildAgent) This is a right place to detect environment and set agent-wide properties using BuildAgentConfiguration interface
 void beforeBuildFinish(AgentRunningBuild build, BuildFinishedStatus buildStatus)
          Called after finishing build but before buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild) or AgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)
 void beforeBuildFinish(BuildFinishedStatus buildStatus)
          Deprecated. 
 void beforeBuildInterrupted(AgentRunningBuild runningBuild, BuildInterruptReason reason)
          Is called after AgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild) Called before build is forcibly terminated, can be called several times if more than one attempt to terminate build is performed.
 void beforeRunnerStart(AgentRunningBuild runningBuild)
          Deprecated. 
 void beforeRunnerStart(BuildRunnerContext runner)
          Called when the build preparation phase is done (sources are gotten, patch is applied, etc.) a runner is about to be launched.
 void buildFinished(AgentRunningBuild build, BuildFinishedStatus buildStatus)
          Called after the buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus) New build may be started while processing this event
 void buildFinished(BuildFinishedStatus buildStatus)
          Deprecated. 
 void buildStarted(AgentRunningBuild runningBuild)
          Called after agent receives start build command from the server.
 void checkoutDirectoryRemoved(java.io.File checkoutDir)
          Called when a build checkout directory was removed from build agent 'work' directory.
 void messageLogged(AgentRunningBuild build, BuildMessage1 buildMessage)
          Called when a build message logged
 void messageLogged(BuildMessage1 buildMessage)
          Called when a build message logged See AgentLifeCycleListener.messageLogged(AgentRunningBuild, jetbrains.buildServer.messages.BuildMessage1)
 void personalPatchApplied(AgentRunningBuild runningBuild)
          Called when personal patch is applied to checkout directory.
 void personalPatchReverted(AgentRunningBuild runningBuild)
          Called when personal patch is reverted Will not be called if build is not personal
 void pluginsLoaded()
          Called after plugin manager has loaded all plugins.
 void runnerFinished(BuildRunnerContext runner, BuildFinishedStatus status)
          Called after AgentLifeCycleListener.beforeRunnerStart(BuildRunnerContext).
 void sourcesUpdated(AgentRunningBuild runningBuild)
          Called when non personal changes are applied to checkout directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentLifeCycleAdapter

public AgentLifeCycleAdapter()
Method Detail

beforeAgentConfigurationLoaded

public void beforeAgentConfigurationLoaded(@NotNull
                                           BuildAgent agent)
Description copied from interface: AgentLifeCycleListener
is called before build agent loaded it's properties and it is called before AgentLifeCycleListener.agentInitialized(BuildAgent) This is a right place to detect environment and set agent-wide properties using BuildAgentConfiguration interface

Specified by:
beforeAgentConfigurationLoaded in interface AgentLifeCycleListener
Parameters:
agent - agent

afterAgentConfigurationLoaded

public void afterAgentConfigurationLoaded(@NotNull
                                          BuildAgent agent)
Description copied from interface: AgentLifeCycleListener
is called after build agent loaded it's properties and it is called before AgentLifeCycleListener.agentInitialized(BuildAgent) This is a right place to update loaded environment and set agent-wide properties using BuildAgentConfiguration interface

Specified by:
afterAgentConfigurationLoaded in interface AgentLifeCycleListener
Parameters:
agent - agent

pluginsLoaded

public void pluginsLoaded()
Description copied from interface: AgentLifeCycleListener
Called after plugin manager has loaded all plugins.

Specified by:
pluginsLoaded in interface AgentLifeCycleListener

agentInitialized

public void agentInitialized(@NotNull
                             BuildAgent agent)
Description copied from interface: AgentLifeCycleListener
Called when method BuildAgent.init(String[]) finished

Specified by:
agentInitialized in interface AgentLifeCycleListener
Parameters:
agent - build agent

agentStarted

public void agentStarted(@NotNull
                         BuildAgent agent)
Description copied from interface: AgentLifeCycleListener
Called after the agent BuildAgent.start() method Agent XML-RPC server is started. You can register your custom XML-RPC handlers here by calling BuildAgent.getXmlRpcHandlerManager() Build agent is ready to accept connections from Server

Specified by:
agentStarted in interface AgentLifeCycleListener
Parameters:
agent - build agent

agentShutdown

public void agentShutdown()
Description copied from interface: AgentLifeCycleListener
Called before agent shutdown

Specified by:
agentShutdown in interface AgentLifeCycleListener

buildStarted

public void buildStarted(@NotNull
                         AgentRunningBuild runningBuild)
Description copied from interface: AgentLifeCycleListener
Called after agent receives start build command from the server. To register custom build parameters provide AgentPropertiesExtension agent extension. Note, methods from that interface are called before that method.

Specified by:
buildStarted in interface AgentLifeCycleListener
Parameters:
runningBuild - information about running build

sourcesUpdated

public void sourcesUpdated(@NotNull
                           AgentRunningBuild runningBuild)
Description copied from interface: AgentLifeCycleListener
Called when non personal changes are applied to checkout directory. Called after AgentLifeCycleListener.buildStarted(AgentRunningBuild) called. Will not be called if checkout mode is set to manual.

Specified by:
sourcesUpdated in interface AgentLifeCycleListener
Parameters:
runningBuild - current running build

personalPatchApplied

public void personalPatchApplied(@NotNull
                                 AgentRunningBuild runningBuild)
Description copied from interface: AgentLifeCycleListener
Called when personal patch is applied to checkout directory. Will not be called if build is not personal

Specified by:
personalPatchApplied in interface AgentLifeCycleListener
Parameters:
runningBuild - current running build

beforeRunnerStart

@Deprecated
public void beforeRunnerStart(@NotNull
                                         AgentRunningBuild runningBuild)
Deprecated. 

Description copied from interface: AgentLifeCycleListener
Called when the build preparation phase is done (sources are gotten, patch is applied, etc.) the runner is about to be launched. Is called after AgentLifeCycleListener.buildStarted(AgentRunningBuild)

Specified by:
beforeRunnerStart in interface AgentLifeCycleListener
Parameters:
runningBuild - running build

beforeRunnerStart

public void beforeRunnerStart(@NotNull
                              BuildRunnerContext runner)
Description copied from interface: AgentLifeCycleListener
Called 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 after AgentLifeCycleListener.buildStarted(AgentRunningBuild), AgentLifeCycleListener.sourcesUpdated(AgentRunningBuild), AgentLifeCycleListener.personalPatchApplied(AgentRunningBuild)

Specified by:
beforeRunnerStart in interface AgentLifeCycleListener
Parameters:
runner - current runner context parameters

runnerFinished

public void runnerFinished(@NotNull
                           BuildRunnerContext runner,
                           @NotNull
                           BuildFinishedStatus status)
Description copied from interface: AgentLifeCycleListener
Called after AgentLifeCycleListener.beforeRunnerStart(BuildRunnerContext). This notification is sent when build runner has finished, crashed or was interrupted.

Specified by:
runnerFinished in interface AgentLifeCycleListener
Parameters:
runner - current runner context parameters
status - status of process run

beforeBuildInterrupted

public void beforeBuildInterrupted(@NotNull
                                   AgentRunningBuild runningBuild,
                                   @NotNull
                                   BuildInterruptReason reason)
Description copied from interface: AgentLifeCycleListener
Is called after AgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild) Called before build is forcibly terminated, can be called several times if more than one attempt to terminate build is performed. For example:

Specified by:
beforeBuildInterrupted in interface AgentLifeCycleListener
Parameters:
runningBuild - running build
reason - reason of build interruption

beforeBuildFinish

@Deprecated
public void beforeBuildFinish(@NotNull
                                         BuildFinishedStatus buildStatus)
Deprecated. 

Description copied from interface: AgentLifeCycleListener
Called after finishing build but before buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild) or AgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)

Specified by:
beforeBuildFinish in interface AgentLifeCycleListener
Parameters:
buildStatus - status of the build

beforeBuildFinish

public void beforeBuildFinish(@NotNull
                              AgentRunningBuild build,
                              @NotNull
                              BuildFinishedStatus buildStatus)
Description copied from interface: AgentLifeCycleListener
Called after finishing build but before buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeRunnerStart(AgentRunningBuild) or AgentLifeCycleListener.beforeBuildInterrupted(AgentRunningBuild, BuildInterruptReason)

Specified by:
beforeBuildFinish in interface AgentLifeCycleListener
Parameters:
build - build
buildStatus - status of the build

personalPatchReverted

public void personalPatchReverted(@NotNull
                                  AgentRunningBuild runningBuild)
Description copied from interface: AgentLifeCycleListener
Called when personal patch is reverted Will not be called if build is not personal

Specified by:
personalPatchReverted in interface AgentLifeCycleListener
Parameters:
runningBuild - current running build

afterAtrifactsPublished

public void afterAtrifactsPublished(@NotNull
                                    AgentRunningBuild runningBuild,
                                    @NotNull
                                    BuildFinishedStatus status)
Description copied from interface: AgentLifeCycleListener
Called when all artifacts were published to the server

Specified by:
afterAtrifactsPublished in interface AgentLifeCycleListener
Parameters:
runningBuild - current running build
status - build status

buildFinished

@Deprecated
public void buildFinished(@NotNull
                                     BuildFinishedStatus buildStatus)
Deprecated. 

Description copied from interface: AgentLifeCycleListener
Called after the buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus) New build may be started while processing this event

Specified by:
buildFinished in interface AgentLifeCycleListener
Parameters:
buildStatus - status of the build

buildFinished

public void buildFinished(@NotNull
                          AgentRunningBuild build,
                          @NotNull
                          BuildFinishedStatus buildStatus)
Description copied from interface: AgentLifeCycleListener
Called after the buildFinished event is sent to the server Is called after AgentLifeCycleListener.beforeBuildFinish(BuildFinishedStatus) New build may be started while processing this event

Specified by:
buildFinished in interface AgentLifeCycleListener
Parameters:
build - build
buildStatus - status of the build

messageLogged

public void messageLogged(@NotNull
                          BuildMessage1 buildMessage)
Description copied from interface: AgentLifeCycleListener
Called when a build message logged See AgentLifeCycleListener.messageLogged(AgentRunningBuild, jetbrains.buildServer.messages.BuildMessage1)

Specified by:
messageLogged in interface AgentLifeCycleListener
Parameters:
buildMessage - build message

messageLogged

public void messageLogged(@NotNull
                          AgentRunningBuild build,
                          @NotNull
                          BuildMessage1 buildMessage)
Description copied from interface: AgentLifeCycleListener
Called when a build message logged

Specified by:
messageLogged in interface AgentLifeCycleListener
Parameters:
build - build that received this message
buildMessage - build message

checkoutDirectoryRemoved

public void checkoutDirectoryRemoved(@NotNull
                                     java.io.File checkoutDir)
Description copied from interface: AgentLifeCycleListener
Called 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:
checkoutDirectoryRemoved in interface AgentLifeCycleListener
Parameters:
checkoutDir - path of the directory. This directory may not exist at the moment of the call.