public class SystemBundleArchive extends java.lang.Object implements BundleArchive
Constructor and Description |
---|
SystemBundleArchive() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
findLibrary(int revision,
java.lang.String libName)
Returns the absolute file path for the specified native library of the
specified revision of the bundle associated with this archive.
|
BundleActivator |
getActivator(java.lang.ClassLoader loader)
Returns the persistent bundle activator of the bundle associated with
this archive; this is a non-standard OSGi method that is only called
when Oscar is running in non-strict OSGi mode.
|
java.lang.String[] |
getClassPath(int revision)
Returns an array of Strings that represent the class path of
the specified revision of the bundle associated with this archive.
|
java.io.File |
getDataFile(java.lang.String fileName)
Returns an appropriate data file for the bundle associated with the
archive using the supplied file name.
|
long |
getId()
Returns the identifier of the bundle associated with this archive.
|
java.lang.String |
getLocation()
Returns the location string of the bundle associated with this archive.
|
java.util.Map |
getManifestHeader(int revision)
Returns the main attributes of the JAR file manifest header of the
specified revision of the bundle associated with this archive.
|
int |
getPersistentState()
Returns the persistent state of the bundle associated with the archive;
this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
|
int |
getRevisionCount()
Returns the number of revisions of the bundle associated with the
archive.
|
int |
getStartLevel()
Returns the start level of the bundle associated with this archive.
|
void |
setActivator(java.lang.Object obj)
Sets the persistent bundle activator of the bundle associated with
this archive; this is a non-standard OSGi method that is only called
when Oscar is running in non-strict OSGi mode.
|
protected void |
setManifestHeader(java.util.Map headerMap) |
void |
setPersistentState(int state)
Sets the persistent state of the bundle associated with this archive;
this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
|
void |
setStartLevel(int level)
Sets the start level of the bundle associated with this archive.
|
public long getId()
BundleArchive
Returns the identifier of the bundle associated with this archive.
getId
in interface BundleArchive
public java.lang.String getLocation() throws java.lang.Exception
BundleArchive
Returns the location string of the bundle associated with this archive.
getLocation
in interface BundleArchive
java.lang.Exception
- if any error occurs.public int getPersistentState() throws java.lang.Exception
BundleArchive
Returns the persistent state of the bundle associated with the archive; this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
getPersistentState
in interface BundleArchive
java.lang.Exception
- if any error occurs.public void setPersistentState(int state) throws java.lang.Exception
BundleArchive
Sets the persistent state of the bundle associated with this archive; this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
setPersistentState
in interface BundleArchive
state
- the new bundle state to write to the archive.java.lang.Exception
- if any error occurs.public int getStartLevel() throws java.lang.Exception
BundleArchive
Returns the start level of the bundle associated with this archive.
getStartLevel
in interface BundleArchive
java.lang.Exception
- if any error occurs.public void setStartLevel(int level) throws java.lang.Exception
BundleArchive
Sets the start level of the bundle associated with this archive.
setStartLevel
in interface BundleArchive
level
- the new bundle start level to write to the archive.java.lang.Exception
- if any error occurs.public java.io.File getDataFile(java.lang.String fileName) throws java.lang.Exception
BundleArchive
Returns an appropriate data file for the bundle associated with the archive using the supplied file name.
getDataFile
in interface BundleArchive
java.lang.Exception
- if any error occurs.public BundleActivator getActivator(java.lang.ClassLoader loader) throws java.lang.Exception
BundleArchive
Returns the persistent bundle activator of the bundle associated with this archive; this is a non-standard OSGi method that is only called when Oscar is running in non-strict OSGi mode.
getActivator
in interface BundleArchive
loader
- the class loader to use when trying to instantiate
the bundle activator.java.lang.Exception
- if any error occurs.public void setActivator(java.lang.Object obj) throws java.lang.Exception
BundleArchive
Sets the persistent bundle activator of the bundle associated with this archive; this is a non-standard OSGi method that is only called when Oscar is running in non-strict OSGi mode.
setActivator
in interface BundleArchive
obj
- the new persistent bundle activator to write to the archive.java.lang.Exception
- if any error occurs.public int getRevisionCount() throws java.lang.Exception
BundleArchive
Returns the number of revisions of the bundle associated with the archive. When a bundle is updated, the previous version of the bundle is maintained along with the new revision until old revisions are purged. The revision count reflects how many revisions of the bundle are currently available in the cache.
getRevisionCount
in interface BundleArchive
java.lang.Exception
- if any error occurs.public java.util.Map getManifestHeader(int revision) throws java.lang.Exception
BundleArchive
Returns the main attributes of the JAR file manifest header of the specified revision of the bundle associated with this archive. The returned map should be case insensitive.
getManifestHeader
in interface BundleArchive
revision
- the specified revision.java.lang.Exception
- if any error occurs.protected void setManifestHeader(java.util.Map headerMap)
public java.lang.String[] getClassPath(int revision) throws java.lang.Exception
BundleArchive
Returns an array of Strings that represent the class path of the specified revision of the bundle associated with this archive. Currently, these values are restricted to absolute paths in the file system, but this may be lifted in the future (perhaps they should be ResourceSources from the Module Loader.
getClassPath
in interface BundleArchive
revision
- the specified revision.java.lang.Exception
- if any error occurs.public java.lang.String findLibrary(int revision, java.lang.String libName) throws java.lang.Exception
BundleArchive
Returns the absolute file path for the specified native library of the specified revision of the bundle associated with this archive.
findLibrary
in interface BundleArchive
revision
- the specified revision.libName
- the name of the library.java.lang.Exception
- if any error occurs.