|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ungoverned.oscar.util.DefaultBundleArchive
public class DefaultBundleArchive
This class, combined with DefaultBundleCache, implements the default file system-based bundle cache for Oscar.
DefaultBundleCache| Constructor Summary | |
|---|---|
DefaultBundleArchive(java.io.File dir,
long id)
|
|
DefaultBundleArchive(java.io.File dir,
long id,
java.lang.String location,
java.io.InputStream is)
|
|
| Method Summary | |
|---|---|
protected static boolean |
deleteDirectoryTree(java.io.File target)
|
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. |
java.io.File |
getDirectory()
|
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 |
getRevisionCountUnchecked()
|
int |
getStartLevel()
Returns the start level of the bundle associated with this archive. |
protected void |
purge()
|
protected void |
remove()
|
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. |
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. |
protected void |
update(java.io.InputStream is)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultBundleArchive(java.io.File dir,
long id,
java.lang.String location,
java.io.InputStream is)
throws java.lang.Exception
java.lang.Exception
public DefaultBundleArchive(java.io.File dir,
long id)
| Method Detail |
|---|
public java.io.File getDirectory()
public long getId()
BundleArchiveReturns the identifier of the bundle associated with this archive.
getId in interface BundleArchive
public java.lang.String getLocation()
throws java.lang.Exception
BundleArchiveReturns the location string of the bundle associated with this archive.
getLocation in interface BundleArchivejava.lang.Exception - if any error occurs.
public int getPersistentState()
throws java.lang.Exception
BundleArchiveReturns the persistent state of the bundle associated with the archive; this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
getPersistentState in interface BundleArchivejava.lang.Exception - if any error occurs.
public void setPersistentState(int state)
throws java.lang.Exception
BundleArchiveSets the persistent state of the bundle associated with this archive; this value will be either Bundle.INSTALLED or Bundle.ACTIVE.
setPersistentState in interface BundleArchivestate - the new bundle state to write to the archive.
java.lang.Exception - if any error occurs.
public int getStartLevel()
throws java.lang.Exception
BundleArchiveReturns the start level of the bundle associated with this archive.
getStartLevel in interface BundleArchivejava.lang.Exception - if any error occurs.
public void setStartLevel(int level)
throws java.lang.Exception
BundleArchiveSets the start level of the bundle associated with this archive.
setStartLevel in interface BundleArchivelevel - 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
BundleArchiveReturns an appropriate data file for the bundle associated with the archive using the supplied file name.
getDataFile in interface BundleArchivejava.lang.Exception - if any error occurs.
public BundleActivator getActivator(java.lang.ClassLoader loader)
throws java.lang.Exception
BundleArchiveReturns 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 BundleArchiveloader - 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
BundleArchiveSets 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 BundleArchiveobj - the new persistent bundle activator to write to the archive.
java.lang.Exception - if any error occurs.
public int getRevisionCount()
throws java.lang.Exception
BundleArchiveReturns 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 BundleArchivejava.lang.Exception - if any error occurs.public int getRevisionCountUnchecked()
public java.util.Map getManifestHeader(int revision)
throws java.lang.Exception
BundleArchiveReturns 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 BundleArchiverevision - the specified revision.
java.lang.Exception - if any error occurs.
public java.lang.String[] getClassPath(int revision)
throws java.lang.Exception
BundleArchiveReturns 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 BundleArchiverevision - 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
BundleArchiveReturns the absolute file path for the specified native library of the specified revision of the bundle associated with this archive.
findLibrary in interface BundleArchiverevision - the specified revision.libName - the name of the library.
java.lang.Exception - if any error occurs.protected static boolean deleteDirectoryTree(java.io.File target)
protected void update(java.io.InputStream is)
throws java.lang.Exception
java.lang.Exception
protected void purge()
throws java.lang.Exception
java.lang.Exception
protected void remove()
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||