org.apache.felix.framework
Class SystemBundleArchive

java.lang.Object
  extended by org.apache.felix.framework.cache.BundleArchive
      extended by org.apache.felix.framework.SystemBundleArchive

public class SystemBundleArchive
extends BundleArchive

This class represents the bundle archive of the system bundle. It is a special case that is mostly just an empty implementation, since the system bundle is not a real archive.


Field Summary
 
Fields inherited from class org.apache.felix.framework.cache.BundleArchive
FILE_PROTOCOL, INPUTSTREAM_PROTOCOL, REFERENCE_PROTOCOL
 
Constructor Summary
SystemBundleArchive(BundleCache cache)
           
 
Method Summary
 void dispose()
           
 org.osgi.framework.BundleActivator getActivator(IModule module)
           Returns the serialized activator for this archive.
 java.lang.String getCurrentLocation()
           
 java.io.File getDataFile(java.lang.String fileName)
           Returns a File object corresponding to the data file of the relative path of the specified string.
 long getId()
           Returns the bundle identifier associated with this archive.
 java.lang.String getLocation()
           Returns the location string associated with this archive.
 java.util.Map getManifestHeader(int revision)
           
 int getPersistentState()
           Returns the persistent state of this archive.
 BundleRevision getRevision(int i)
           Returns the revision object for the specified revision.
 int getRevisionCount()
           Returns the number of revisions available for this archive.
 int getStartLevel()
           Returns the start level of this archive.
 void purge()
           This method removes all old revisions associated with the archive and keeps only the current revision.
 void revise(java.lang.String location, java.io.InputStream is)
           This method adds a revision to the archive.
 void setActivator(java.lang.Object obj)
           Serializes the activator for this archive.
 void setCurrentLocation(java.lang.String location)
           
 void setManifestHeader(java.util.Map headerMap)
           
 void setPersistentState(int state)
           Sets the persistent state of this archive.
 void setStartLevel(int level)
           Sets the the start level of this archive this archive.
 
Methods inherited from class org.apache.felix.framework.cache.BundleArchive
getLastModified, setLastModified, undoRevise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemBundleArchive

public SystemBundleArchive(BundleCache cache)
Method Detail

getId

public long getId()
Description copied from class: BundleArchive

Returns the bundle identifier associated with this archive.

Overrides:
getId in class BundleArchive
Returns:
the bundle identifier associated with this archive.

getLocation

public java.lang.String getLocation()
                             throws java.lang.Exception
Description copied from class: BundleArchive

Returns the location string associated with this archive.

Overrides:
getLocation in class BundleArchive
Returns:
the location string associated with this archive.
Throws:
java.lang.Exception - if any error occurs.

getCurrentLocation

public java.lang.String getCurrentLocation()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

setCurrentLocation

public void setCurrentLocation(java.lang.String location)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getPersistentState

public int getPersistentState()
                       throws java.lang.Exception
Description copied from class: BundleArchive

Returns the persistent state of this archive. The value returned is one of the following: Bundle.INSTALLED, Bundle.ACTIVE, or Bundle.UNINSTALLED.

Overrides:
getPersistentState in class BundleArchive
Returns:
the persistent state of this archive.
Throws:
java.lang.Exception - if any error occurs.

setPersistentState

public void setPersistentState(int state)
                        throws java.lang.Exception
Description copied from class: BundleArchive

Sets the persistent state of this archive. The value is one of the following: Bundle.INSTALLED, Bundle.ACTIVE, or Bundle.UNINSTALLED.

Overrides:
setPersistentState in class BundleArchive
Parameters:
state - the persistent state value to set for this archive.
Throws:
java.lang.Exception - if any error occurs.

getStartLevel

public int getStartLevel()
                  throws java.lang.Exception
Description copied from class: BundleArchive

Returns the start level of this archive.

Overrides:
getStartLevel in class BundleArchive
Returns:
the start level of this archive.
Throws:
java.lang.Exception - if any error occurs.

setStartLevel

public void setStartLevel(int level)
                   throws java.lang.Exception
Description copied from class: BundleArchive

Sets the the start level of this archive this archive.

Overrides:
setStartLevel in class BundleArchive
Parameters:
level - the start level to set for this archive.
Throws:
java.lang.Exception - if any error occurs.

getDataFile

public java.io.File getDataFile(java.lang.String fileName)
                         throws java.lang.Exception
Description copied from class: BundleArchive

Returns a File object corresponding to the data file of the relative path of the specified string.

Overrides:
getDataFile in class BundleArchive
Returns:
a File object corresponding to the specified file name.
Throws:
java.lang.Exception - if any error occurs.

getActivator

public org.osgi.framework.BundleActivator getActivator(IModule module)
                                                throws java.lang.Exception
Description copied from class: BundleArchive

Returns the serialized activator for this archive. This is an extension to the OSGi specification.

Overrides:
getActivator in class BundleArchive
Returns:
the serialized activator for this archive.
Throws:
java.lang.Exception - if any error occurs.

setActivator

public void setActivator(java.lang.Object obj)
                  throws java.lang.Exception
Description copied from class: BundleArchive

Serializes the activator for this archive.

Overrides:
setActivator in class BundleArchive
Parameters:
obj - the activator to serialize.
Throws:
java.lang.Exception - if any error occurs.

getRevisionCount

public int getRevisionCount()
Description copied from class: BundleArchive

Returns the number of revisions available for this archive.

Overrides:
getRevisionCount in class BundleArchive
Returns:
tthe number of revisions available for this archive.

getRevision

public BundleRevision getRevision(int i)
Description copied from class: BundleArchive

Returns the revision object for the specified revision.

Overrides:
getRevision in class BundleArchive
Returns:
the revision object for the specified revision.

revise

public void revise(java.lang.String location,
                   java.io.InputStream is)
            throws java.lang.Exception
Description copied from class: BundleArchive

This method adds a revision to the archive. The revision is created based on the specified location and/or input stream.

Overrides:
revise in class BundleArchive
Parameters:
location - the location string associated with the revision.
Throws:
java.lang.Exception - if any error occurs.

purge

public void purge()
           throws java.lang.Exception
Description copied from class: BundleArchive

This method removes all old revisions associated with the archive and keeps only the current revision.

Overrides:
purge in class BundleArchive
Throws:
java.lang.Exception - if any error occurs.

dispose

public void dispose()
             throws java.lang.Exception
Throws:
java.lang.Exception

getManifestHeader

public java.util.Map getManifestHeader(int revision)

setManifestHeader

public void setManifestHeader(java.util.Map headerMap)