com.atlassian.bamboo.v2.build.agent
Interface ExecutableBuildAgent

All Known Implementing Classes:
DefaultBuildAgent

public interface ExecutableBuildAgent

The ExecutableBuildAgent that is able to be run builds. Basically it's an agent that's "local" to the running directory


Method Summary
 void build(BuildContext currentlyBuilding, ReadOnlyCapabilitySet agentCapabilities)
          Executes the passed BuildContext
 void cancelBuild(java.lang.String buildResultKey)
          Cancels the passed buildResultKey if it matches
 AgentStatus getAgentStatus()
           
 BuildContext getBuilding()
          Gets the BuildContext related to the build that is building on the agent.
 long getId()
          Agent id
 java.lang.String getName()
          Agent name
 int incrementError()
          Tells the agent that an unhandled error has occurred.
 boolean isActive()
           
 void resetErrors()
          Resetes the error count
 void start()
          Starts the build agent
 void stop()
          Stops the build agent immedaitely.
 void stopNicely()
          Attempt to stop the agent and wait for the current build (if any) to stop building
 void waitForStop(int secondsToWait)
          Waits a certain number of seconds for a build to stop.
 

Method Detail

getId

long getId()
Agent id

Returns:

getName

java.lang.String getName()
Agent name

Returns:

start

void start()
Starts the build agent


stop

void stop()
Stops the build agent immedaitely. Cancelling all currently running builds

Throws:
java.lang.InterruptedException

stopNicely

void stopNicely()
Attempt to stop the agent and wait for the current build (if any) to stop building


build

void build(@NotNull
           BuildContext currentlyBuilding,
           @NotNull
           ReadOnlyCapabilitySet agentCapabilities)
           throws java.lang.Exception
Executes the passed BuildContext

Parameters:
currentlyBuilding -
agentCapabilities -
Throws:
java.lang.Exception

cancelBuild

void cancelBuild(@NotNull
                 java.lang.String buildResultKey)
Cancels the passed buildResultKey if it matches

Parameters:
buildResultKey -

getAgentStatus

AgentStatus getAgentStatus()

isActive

boolean isActive()

getBuilding

@Nullable
BuildContext getBuilding()
Gets the BuildContext related to the build that is building on the agent. Null if not building or cancelling anything.

Returns:

waitForStop

void waitForStop(int secondsToWait)
                 throws java.util.concurrent.TimeoutException
Waits a certain number of seconds for a build to stop.

Parameters:
secondsToWait - -
Throws:
java.util.concurrent.TimeoutException

incrementError

int incrementError()
Tells the agent that an unhandled error has occurred. The agent may then choose to stop the error if a thredhold has been reached. Provides an overload of exceptions being thrown.

Returns:

resetErrors

void resetErrors()
Resetes the error count



Copyright © 2010 Atlassian. All Rights Reserved.