org.apache.felix.framework.cache
Class BundleCache
java.lang.Object
org.apache.felix.framework.cache.BundleCache
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:
- felix.cache.bufsize - Sets the buffer size to be used by
the cache; the default value is 4096. The integer
value of this string provides control over the size of the
internal buffer of the disk cache for performance reasons.
- felix.cache.dir - Sets the directory to be used by the
cache as its cache directory. The cache directory is where all
profile directories are stored and a profile directory is where a
set of installed bundles are stored. By default, the cache
directory is .felix in the user's home directory. If
this property is specified, then its value will be used as the cache
directory instead of .felix. This directory will be created
if it does not exist.
- felix.cache.profile - Sets the profile name that will be
used to create a profile directory inside of the cache directory.
The created directory will contained all installed bundles associated
with the profile.
- felix.cache.profiledir - Sets the directory to use as the
profile directory for the bundle cache; by default the profile
name is used to create a directory in the .felix cache
directory. If this property is specified, then the cache directory
and profile name properties are ignored. The specified value of this
property is used directly as the directory to contain all cached
bundles. If this property is set, it is not necessary to set the
cache directory or profile name properties. This directory will be
created if it does not exist.
For specific information on how to configure Felix using system properties,
refer to the Felix usage documentation.
- See Also:
org.apache.felix.framework.util.BundleArchive
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CACHE_BUFSIZE_PROP
public static final java.lang.String CACHE_BUFSIZE_PROP
- See Also:
- Constant Field Values
CACHE_DIR_PROP
public static final java.lang.String CACHE_DIR_PROP
- See Also:
- Constant Field Values
CACHE_PROFILE_DIR_PROP
public static final java.lang.String CACHE_PROFILE_DIR_PROP
- See Also:
- Constant Field Values
CACHE_PROFILE_PROP
public static final java.lang.String CACHE_PROFILE_PROP
- See Also:
- Constant Field Values
BUFSIZE
protected static transient int BUFSIZE
CACHE_DIR_NAME
protected static final transient java.lang.String CACHE_DIR_NAME
- See Also:
- Constant Field Values
BUNDLE_DIR_PREFIX
protected static final transient java.lang.String BUNDLE_DIR_PREFIX
- See Also:
- Constant Field Values
BundleCache
public BundleCache(Logger logger,
java.util.Map configMap)
throws java.lang.Exception
- Throws:
java.lang.Exception
getArchives
public BundleArchive[] getArchives()
throws java.lang.Exception
- Throws:
java.lang.Exception
getArchive
public BundleArchive getArchive(long id)
throws java.lang.Exception
- Throws:
java.lang.Exception
getArchiveIndex
public int getArchiveIndex(BundleArchive ba)
create
public BundleArchive create(long id,
java.lang.String location,
java.io.InputStream is)
throws java.lang.Exception
- Throws:
java.lang.Exception
remove
public void remove(BundleArchive ba)
throws java.lang.Exception
- Throws:
java.lang.Exception
getSystemBundleDataFile
public java.io.File getSystemBundleDataFile(java.lang.String fileName)
throws java.lang.Exception
- 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.
- Parameters:
fileName
- the name of the file in the system bundle's private area.
- Returns:
- a File object corresponding to the specified file name.
- Throws:
java.lang.Exception
- if any error occurs.
copyStreamToFile
protected static void copyStreamToFile(java.io.InputStream is,
java.io.File outputFile)
throws java.io.IOException
- This method copies an input stream to the specified file.
- Parameters:
is
- the input stream to copy.outputFile
- the file to which the input stream should be copied.
- Throws:
java.io.IOException
deleteDirectoryTree
protected static boolean deleteDirectoryTree(java.io.File target)