com.atlassian.bamboo.v2.build.queue
Class BuildQueueManagerImpl
java.lang.Object
com.atlassian.bamboo.v2.build.queue.AgentQueueAccessorImpl
com.atlassian.bamboo.v2.build.queue.BuildQueueManagerImpl
- All Implemented Interfaces:
- AgentQueueAccessor, BuildQueueManager
public class BuildQueueManagerImpl
- extends AgentQueueAccessorImpl
- implements BuildQueueManager
Field Summary |
protected java.util.concurrent.locks.ReadWriteLock |
queueLock
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
queueLock
protected java.util.concurrent.locks.ReadWriteLock queueLock
BuildQueueManagerImpl
public BuildQueueManagerImpl(com.atlassian.event.EventManager eventManager,
BuildExecutionManager buildExecutionManager,
BuildManager buildManager,
LocalAgentManager localAgentManager,
org.springframework.jms.core.JmsTemplate jmsTemplate)
addBuildToQueue
public void addBuildToQueue(@NotNull
BuildContext buildContext)
- Description copied from interface:
BuildQueueManager
- Attempts to add the build to a queue. A
BuildQueuedEvent
is fired if queuing was successful and a
BuildRejectedFromQueueEvent
iif rejected.
A lock on the build is obtained from the BuildExecutionManager
.
- Specified by:
addBuildToQueue
in interface BuildQueueManager
- Parameters:
buildContext
- @NotNull
removeBuildFromQueue
public void removeBuildFromQueue(@NotNull
java.lang.String planKey)
- Description copied from interface:
BuildQueueManager
- Removes the
BuildContext
associated with the buildResultKey to be removed form the queue.
A BuildDeQueuedEvent
is fired.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
- Specified by:
removeBuildFromQueue
in interface BuildQueueManager
getBuildQueue
@NotNull
public java.util.List<BuildContext> getBuildQueue()
- Description copied from interface:
BuildQueueManager
- Returns a thread safe list of
BuildContext
objects representing the builds that is
in the queue
- Specified by:
getBuildQueue
in interface BuildQueueManager
- Returns:
List
of BuildContext
. Changes to this List is not reflected in the queue.
queueContains
public boolean queueContains(java.lang.String planKey)
- Description copied from interface:
BuildQueueManager
Indicates whether a build of a given build plan is in the queue.
- Specified by:
queueContains
in interface BuildQueueManager
- Parameters:
planKey
- The build plan key
- Returns:
true
if a build of the given build plan is in the queue, false
otherwise.
reconstructBuildQueue
public void reconstructBuildQueue()
- Description copied from interface:
BuildQueueManager
- Reconstructs the build queue. This needs to happen in the following scenarios:
- Agent capability gets updated
- Agent enabled/disabled
- Plan configuration (requirements) updated.
- Specified by:
reconstructBuildQueue
in interface BuildQueueManager
Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.