com.atlassian.bamboo.persister
Class CachedBuildPersisterDecorator

java.lang.Object
  extended by com.atlassian.bamboo.persister.CachedBuildPersisterDecorator
All Implemented Interfaces:
Startable, BuildPersisterDecorator

public class CachedBuildPersisterDecorator
extends java.lang.Object
implements BuildPersisterDecorator

Caches the builds so speed up performance and handle transient Build fields.


Constructor Summary
CachedBuildPersisterDecorator(BuildPersisterDecorator parent)
           
 
Method Summary
 void deleteBuildResults(Buildable buildable, long buildNumber)
          Remove a specific build build
 boolean isActive()
          Indicates whether this is currently active.
 BuildResults loadBuildResults(java.lang.String planKey, java.lang.Integer buildNumber)
          Cache the build results so that the least used results get purged
 void saveBuildResults(Buildable buildable, BuildResults buildResults)
          Simply pass this request onto the parent
 void start()
          Loads the cache from the parent decorator on startup;
 void stop()
          Stop the component and clean up any resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedBuildPersisterDecorator

public CachedBuildPersisterDecorator(BuildPersisterDecorator parent)
Method Detail

start

public void start()
           throws java.lang.Exception
Loads the cache from the parent decorator on startup;

Specified by:
start in interface Startable
Throws:
java.lang.Exception - a generic failure

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: Startable
Stop the component and clean up any resources

Specified by:
stop in interface Startable
Throws:
java.lang.Exception - A generic failure

isActive

public boolean isActive()
Description copied from interface: Startable

Indicates whether this is currently active.

Specified by:
isActive in interface Startable
Returns:
true if this is active, false otherwise.

deleteBuildResults

public void deleteBuildResults(Buildable buildable,
                               long buildNumber)
                        throws PersisterException
Remove a specific build build

Specified by:
deleteBuildResults in interface BuildPersisterDecorator
Parameters:
buildable -
buildNumber - The build number
Throws:
PersisterException

saveBuildResults

public void saveBuildResults(Buildable buildable,
                             BuildResults buildResults)
                      throws PersisterException
Simply pass this request onto the parent

Specified by:
saveBuildResults in interface BuildPersisterDecorator
buildResults - The build results to persist @throws PersisterException Failed to persist the build results
Throws:
PersisterException

loadBuildResults

public BuildResults loadBuildResults(java.lang.String planKey,
                                     java.lang.Integer buildNumber)
                              throws PersisterException
Cache the build results so that the least used results get purged

Specified by:
loadBuildResults in interface BuildPersisterDecorator
buildNumber - The number of the build results we are interested in
Returns:
The buildResults
Throws:
PersisterException - Failed to load the build results


Copyright © 2010 Atlassian. All Rights Reserved.