org.apache.felix.framework.cache
Class BundleCache

java.lang.Object
  extended by 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:

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 java.lang.String BUNDLE_DIR_PREFIX
           
static java.lang.String CACHE_BUFSIZE_PROP
           
protected static java.lang.String CACHE_DIR_NAME
           
protected static java.lang.String CACHE_ROOTDIR_DEFAULT
           
static java.lang.String CACHE_ROOTDIR_PROP
           
 
Constructor Summary
BundleCache(Logger logger, java.util.Map configMap)
           
 
Method Summary
protected 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, java.lang.String location, java.io.InputStream is)
           
protected static boolean deleteDirectoryTree(java.io.File target)
           
 void flush()
           
 BundleArchive getArchive(long id)
           
 int getArchiveIndex(BundleArchive ba)
           
 BundleArchive[] getArchives()
           
 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 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 java.lang.String CACHE_BUFSIZE_PROP
See Also:
Constant Field Values

CACHE_ROOTDIR_PROP

public static final java.lang.String CACHE_ROOTDIR_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

CACHE_ROOTDIR_DEFAULT

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

BUNDLE_DIR_PREFIX

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

BundleCache

public BundleCache(Logger logger,
                   java.util.Map configMap)
            throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

flush

public void flush()
           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)


Copyright © 2006-2009 The Apache Software Foundation. All Rights Reserved.