org.apache.felix.framework.cache
Class BundleCache

java.lang.Object
  extended by org.apache.felix.framework.cache.BundleCache

public class BundleCache
extends 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:

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

Field Summary
protected static int BUFSIZE
           
protected static String BUNDLE_DIR_PREFIX
           
static String CACHE_BUFSIZE_PROP
           
protected static String CACHE_DIR_NAME
           
protected static String CACHE_ROOTDIR_DEFAULT
           
static String CACHE_ROOTDIR_PROP
           
 
Constructor Summary
BundleCache(Logger logger, Map configMap)
           
 
Method Summary
protected static void copyStreamToFile(InputStream is, File outputFile)
          This method copies an input stream to the specified file.
 BundleArchive create(long id, String location, InputStream is)
           
protected static boolean deleteDirectoryTree(File target)
           
 void flush()
           
 BundleArchive getArchive(long id)
           
 int getArchiveIndex(BundleArchive ba)
           
 BundleArchive[] getArchives()
           
 File getSystemBundleDataFile(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 remove(BundleArchive ba)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_BUFSIZE_PROP

public static final String CACHE_BUFSIZE_PROP
See Also:
Constant Field Values

CACHE_ROOTDIR_PROP

public static final String CACHE_ROOTDIR_PROP
See Also:
Constant Field Values

BUFSIZE

protected static transient int BUFSIZE

CACHE_DIR_NAME

protected static final transient String CACHE_DIR_NAME
See Also:
Constant Field Values

CACHE_ROOTDIR_DEFAULT

protected static final transient String CACHE_ROOTDIR_DEFAULT
See Also:
Constant Field Values

BUNDLE_DIR_PREFIX

protected static final transient String BUNDLE_DIR_PREFIX
See Also:
Constant Field Values
Constructor Detail

BundleCache

public BundleCache(Logger logger,
                   Map configMap)
            throws Exception
Throws:
Exception
Method Detail

flush

public void flush()
           throws Exception
Throws:
Exception

getArchives

public BundleArchive[] getArchives()
                            throws Exception
Throws:
Exception

getArchive

public BundleArchive getArchive(long id)
                         throws Exception
Throws:
Exception

getArchiveIndex

public int getArchiveIndex(BundleArchive ba)

create

public BundleArchive create(long id,
                            String location,
                            InputStream is)
                     throws Exception
Throws:
Exception

remove

public void remove(BundleArchive ba)
            throws Exception
Throws:
Exception

getSystemBundleDataFile

public File getSystemBundleDataFile(String fileName)
                             throws 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:
Exception - if any error occurs.

copyStreamToFile

protected static void copyStreamToFile(InputStream is,
                                       File outputFile)
                                throws 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:
IOException

deleteDirectoryTree

protected static boolean deleteDirectoryTree(File target)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.