com.atlassian.plugin.osgi.container.impl
Class DefaultOsgiPersistentCache

java.lang.Object
  extended by com.atlassian.plugin.osgi.container.impl.DefaultOsgiPersistentCache
All Implemented Interfaces:
OsgiPersistentCache

public class DefaultOsgiPersistentCache
extends Object
implements OsgiPersistentCache

Default implementation of persistent cache. Handles clearing of directories if an upgrade has been detected.

Since:
2.2.0

Constructor Summary
DefaultOsgiPersistentCache(File baseDir)
          Constructs a cache, using the passed file as the base directory for cache subdirectories
DefaultOsgiPersistentCache(File baseDir, String applicationVersion)
          Deprecated.  
 
Method Summary
 void clear()
          Clear all caches
 File getFrameworkBundleCache()
           
 File getOsgiBundleCache()
           
 File getTransformedPluginCache()
           
 void validate(String cacheValidationKey)
          Validates the caches against a cache key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOsgiPersistentCache

public DefaultOsgiPersistentCache(File baseDir)
Constructs a cache, using the passed file as the base directory for cache subdirectories

Parameters:
baseDir - The base directory

DefaultOsgiPersistentCache

@Deprecated
public DefaultOsgiPersistentCache(File baseDir,
                                             String applicationVersion)
Deprecated. 

Constructor added in the 2.2.0 beta timeframe, but was made redundant later. Application version is not used.

Method Detail

getFrameworkBundleCache

public File getFrameworkBundleCache()
Specified by:
getFrameworkBundleCache in interface OsgiPersistentCache
Returns:
the directory to store extracted framework bundles

getOsgiBundleCache

public File getOsgiBundleCache()
Specified by:
getOsgiBundleCache in interface OsgiPersistentCache
Returns:
the directory to use for the container bundle cache

getTransformedPluginCache

public File getTransformedPluginCache()
Specified by:
getTransformedPluginCache in interface OsgiPersistentCache
Returns:
the directory to store transformed plugins

clear

public void clear()
           throws OsgiContainerException
Description copied from interface: OsgiPersistentCache
Clear all caches

Specified by:
clear in interface OsgiPersistentCache
Throws:
OsgiContainerException - If the caches couldn't be cleared

validate

public void validate(String cacheValidationKey)
Description copied from interface: OsgiPersistentCache
Validates the caches against a cache key. If the key changes, the directories are wiped clean.

Specified by:
validate in interface OsgiPersistentCache
Parameters:
cacheValidationKey - The cache key, can be anything


Copyright © 2012 Atlassian. All Rights Reserved.