public class BundleCache
extends java.lang.Object
This class, combined with BundleArchive, and concrete BundleRevision subclasses, implement the Felix bundle cache. It is possible to configure the default behavior of this class by passing properties into Felix' constructor. The configuration properties for this class are (properties starting with "felix" are specific to Felix, while those starting with "org.osgi" are standard OSGi properties):
For specific information on how to configure the Felix framework, refer to the Felix framework usage documentation.
BundleArchive| Modifier and Type | Field and Description |
|---|---|
protected static int |
BUFSIZE |
(package private) static java.lang.String |
BUNDLE_DIR_PREFIX |
static java.lang.String |
CACHE_BUFSIZE_PROP |
private static java.lang.String |
CACHE_DIR_NAME |
static java.lang.String |
CACHE_FILELIMIT_PROP |
private static java.lang.String |
CACHE_LOCK_NAME |
static java.lang.String |
CACHE_LOCKING_PROP |
private static java.lang.String |
CACHE_ROOTDIR_DEFAULT |
static java.lang.String |
CACHE_ROOTDIR_PROP |
static java.lang.String |
CACHE_SINGLEBUNDLEFILE_PROP |
private java.util.Map |
m_configMap |
private java.lang.Object |
m_lock |
private Logger |
m_logger |
private static SecureAction |
m_secureAction |
private WeakZipFileFactory |
m_zipFactory |
| Constructor and Description |
|---|
BundleCache(Logger logger,
java.util.Map configMap) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
copyStreamToFile(java.io.InputStream is,
java.io.File outputFile)
This method copies an input stream to the specified file.
|
BundleArchive |
create(long id,
int startLevel,
java.lang.String location,
java.io.InputStream is) |
void |
delete() |
(package private) static boolean |
deleteDirectoryTree(java.io.File target) |
private static boolean |
deleteDirectoryTreeRecursive(java.io.File target) |
private static java.io.File |
determineCacheDir(java.util.Map configMap) |
BundleArchive[] |
getArchives() |
(package private) static SecureAction |
getSecureAction() |
java.io.File |
getSystemBundleDataFile(java.lang.String fileName)
Provides the system bundle access to its private storage area; this
special case is necessary since the system bundle is not really a
bundle and therefore must be treated in a special way.
|
void |
release() |
public static final java.lang.String CACHE_BUFSIZE_PROP
public static final java.lang.String CACHE_ROOTDIR_PROP
public static final java.lang.String CACHE_LOCKING_PROP
public static final java.lang.String CACHE_FILELIMIT_PROP
public static final java.lang.String CACHE_SINGLEBUNDLEFILE_PROP
protected static transient int BUFSIZE
private static final transient java.lang.String CACHE_DIR_NAME
private static final transient java.lang.String CACHE_ROOTDIR_DEFAULT
private static final transient java.lang.String CACHE_LOCK_NAME
static final transient java.lang.String BUNDLE_DIR_PREFIX
private static final SecureAction m_secureAction
private final Logger m_logger
private final java.util.Map m_configMap
private final WeakZipFileFactory m_zipFactory
private final java.lang.Object m_lock
public BundleCache(Logger logger, java.util.Map configMap) throws java.lang.Exception
java.lang.Exceptionpublic void release()
static SecureAction getSecureAction()
public void delete()
throws java.lang.Exception
java.lang.Exceptionpublic BundleArchive[] getArchives() throws java.lang.Exception
java.lang.Exceptionpublic BundleArchive create(long id, int startLevel, java.lang.String location, java.io.InputStream is) throws java.lang.Exception
java.lang.Exceptionpublic java.io.File getSystemBundleDataFile(java.lang.String fileName)
throws java.lang.Exception
fileName - the name of the file in the system bundle's private area.java.lang.Exception - if any error occurs.static void copyStreamToFile(java.io.InputStream is,
java.io.File outputFile)
throws java.io.IOException
is - the input stream to copy.outputFile - the file to which the input stream should be copied.java.io.IOExceptionstatic boolean deleteDirectoryTree(java.io.File target)
private static java.io.File determineCacheDir(java.util.Map configMap)
private static boolean deleteDirectoryTreeRecursive(java.io.File target)