Interface AgentQueueAccessor
-
- All Known Subinterfaces:
BuildQueueManager
- All Known Implementing Classes:
AgentQueueAccessorImpl,BuildQueueManagerImpl
public interface AgentQueueAccessor
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAgentQueueAccessor.QueueAccessResult
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable CommonContexttakeBuildContext(long agentId)Deprecated.since 7.1 use {takeContext(long)}@NotNull AgentQueueAccessor.QueueAccessResulttakeContext(long agentId)Takes aCommonContextfrom the queue, blocking until one is available.@NotNull AgentQueueAccessor.QueueAccessResulttakeContext(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.
-
-
-
Method Detail
-
takeBuildContext
@Deprecated @Nullable @Nullable CommonContext takeBuildContext(long agentId) throws InterruptedException
Deprecated.since 7.1 use {takeContext(long)}Takes 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.- Parameters:
agentId- 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
@NotNull @NotNull AgentQueueAccessor.QueueAccessResult takeContext(long agentId) throws InterruptedException
Takes 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.- 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
@NotNull @NotNull AgentQueueAccessor.QueueAccessResult takeContext(long agentId, @Nullable @Nullable ResultKey resultKey) throws InterruptedException
If 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 totakeContext(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.- 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.- Since:
- 9.1
-
-