Interface ExecutableBuildAgent
-
- All Known Implementing Classes:
DefaultBuildAgent,RemoteBuildAgent
public interface ExecutableBuildAgentTheExecutableBuildAgentthat is able to be run builds. Basically it's an agent that's "local" to the running directory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbuild(@NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull DockerContainerController dockerContainerController)Executes the passedCommonContextbooleancancelBuild(@NotNull String buildResultKey)Cancels the passed buildResultKey if it matches<V> VexecuteWithCurrentContext(Callable<V> callable)Execute with guarantee that context will not be switched during execution.AgentStatusgetAgentStatus()@Nullable CommonContextgetBuilding()Gets theBuildContextrelated to the build that is building on the agent.@NotNull StringgetDescription()Agent descriptionlonggetId()Agent idStringgetName()Agent nameintincrementError()Tells the agent that an unhandled error has occurred.booleanisActive()voidonBuildProcessingFinished()This method is called when the build process is completed and the result processing has finished.voidonContextReceived(@NotNull CommonContext commonContext)This method is called when the agent has just retrieved a context from queuevoidresetErrors()Resetes the error countvoidsetContextToBuild(@NotNull CommonContext context)voidstart()Starts the build agentvoidstop()Stops the build agent immediately.voidstopNicely()Attempt to stop the agent and wait for the current build (if any) to stop buildingvoidstopNicely(int statusCode)Attempt to stop the agent and wait for the current build (if any) to stop building.voidwaitForStop(int secondsToWait)Waits a certain number of seconds for a build to stop.
-
-
-
Method Detail
-
getId
long getId()
Agent id- Returns:
-
getName
String getName()
Agent name- Returns:
-
getDescription
@NotNull @NotNull String getDescription()
Agent description
-
start
void start()
Starts the build agent
-
stop
void stop()
Stops the build agent immediately. Cancelling all currently running builds- Throws:
InterruptedException
-
stopNicely
void stopNicely()
Attempt to stop the agent and wait for the current build (if any) to stop building
-
stopNicely
void stopNicely(int statusCode)
Attempt to stop the agent and wait for the current build (if any) to stop building. If it's a non-local agent, then it will terminate with the given status code.
-
build
void build(@NotNull @NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull @NotNull DockerContainerController dockerContainerController) throws ExceptionExecutes the passedCommonContext- Parameters:
agentCapabilities-- Throws:
Exception
-
cancelBuild
boolean cancelBuild(@NotNull @NotNull String buildResultKey)Cancels the passed buildResultKey if it matches- Parameters:
buildResultKey-
-
getAgentStatus
AgentStatus getAgentStatus()
-
isActive
boolean isActive()
-
getBuilding
@Nullable @Nullable CommonContext getBuilding()
Gets theBuildContextrelated to the build that is building on the agent. Null if not building or cancelling anything.- Returns:
-
setContextToBuild
void setContextToBuild(@NotNull @NotNull CommonContext context)
-
waitForStop
void waitForStop(int secondsToWait) throws TimeoutExceptionWaits a certain number of seconds for a build to stop.- Parameters:
secondsToWait- -- Throws:
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
-
onBuildProcessingFinished
void onBuildProcessingFinished()
This method is called when the build process is completed and the result processing has finished.
-
onContextReceived
void onContextReceived(@NotNull @NotNull CommonContext commonContext)This method is called when the agent has just retrieved a context from queue
-
-