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 class
AgentQueueAccessor.QueueAccessResult
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable CommonContext
takeBuildContext(long agentId)
Deprecated.since 7.1 use {takeContext(long)
}@NotNull AgentQueueAccessor.QueueAccessResult
takeContext(long agentId)
Takes aCommonContext
from the queue, blocking until one is available.@NotNull AgentQueueAccessor.QueueAccessResult
takeContext(long agentId, @Nullable ResultKey resultKey)
If resultKey is not null, takes a specificCommonContext
from 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 aCommonContext
from 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 callingThread
is interrupted.
-
takeContext
@NotNull @NotNull AgentQueueAccessor.QueueAccessResult takeContext(long agentId) throws InterruptedException
Takes aCommonContext
from 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.QueueAccessResult
containing:CommonContext
on success, error message on error, nulls in case of timeout on retrieval. - Throws:
InterruptedException
- if the callingThread
is interrupted.
-
takeContext
@NotNull @NotNull AgentQueueAccessor.QueueAccessResult takeContext(long agentId, @Nullable @Nullable ResultKey resultKey) throws InterruptedException
If resultKey is not null, takes a specificCommonContext
from 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.QueueAccessResult
containing:CommonContext
on success, error message on error, nulls in case of timeout on retrieval. - Throws:
InterruptedException
- if the callingThread
is interrupted.- Since:
- 9.1
-
-