Class AgentQueueAccessorImpl
java.lang.Object
com.atlassian.bamboo.v2.build.queue.AgentQueueAccessorImpl
- All Implemented Interfaces:
AgentQueueAccessor
An instance of this class is shared between multiple local agents
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.v2.build.queue.AgentQueueAccessor
AgentQueueAccessor.QueueAccessResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable CommonContexttakeBuildContext(long id) Takes aCommonContextfrom the queue, blocking until one is available.takeContext(long agentId) Takes aCommonContextfrom the queue, blocking until one is available.takeContext(long agentId, @Nullable ResultKey resultKey) If resultKey is not null, takes a specificCommonContextfrom the queue or nothing if there's no job with specified key in the queue.
-
Constructor Details
-
AgentQueueAccessorImpl
public AgentQueueAccessorImpl()
-
-
Method Details
-
takeBuildContext
Description copied from interface:AgentQueueAccessorTakes aCommonContextfrom the queue, blocking until one is available.The lock on the build is not released. The caller should call
com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey)to release this lock when ready.- Specified by:
takeBuildContextin interfaceAgentQueueAccessor- Parameters:
id- the id of the agent that is taking the build context.- Returns:
- The
CommonContext, null in case of timeout on retrieval. - Throws:
InterruptedException- if the callingThreadis interrupted.
-
takeContext
Description copied from interface:AgentQueueAccessorTakes aCommonContextfrom the queue, blocking until one is available.The lock on the build is not released. The caller should call
com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey)to release this lock when ready.- Specified by:
takeContextin interfaceAgentQueueAccessor- Parameters:
agentId- the id of the agent that is taking the build context.- Returns:
- The
AgentQueueAccessor.QueueAccessResultcontaining:CommonContexton success, error message on error, nulls in case of timeout on retrieval. - Throws:
InterruptedException- if the callingThreadis interrupted.
-
takeContext
public AgentQueueAccessor.QueueAccessResult takeContext(long agentId, @Nullable @Nullable ResultKey resultKey) throws InterruptedException Description copied from interface:AgentQueueAccessorIf resultKey is not null, takes a specificCommonContextfrom the queue or nothing if there's no job with specified key in the queue. If resultKey is null, behaved identically toAgentQueueAccessor.takeContext(long).The lock on the build is not released. The caller should call
com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey)to release this lock when ready.- Specified by:
takeContextin interfaceAgentQueueAccessor- Parameters:
agentId- the id of the agent that is taking the build context.resultKey- of the job that agent expects to receive- Returns:
- The
AgentQueueAccessor.QueueAccessResultcontaining:CommonContexton success, error message on error, nulls in case of timeout on retrieval. - Throws:
InterruptedException- if the callingThreadis interrupted.
-