org.knopflerfish.framework.BundleArchive Interface Reference

Inheritance diagram for org.knopflerfish.framework.BundleArchive:

org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl

List of all members.


Detailed Description

Interface for managing bundle data.

Author:
Jan Stein

Philippe Laporte

Mats-Ola Persson

Definition at line 51 of file BundleArchive.java.


Public Member Functions

Hashtable getLocalizationEntries (String localeFile)
 Gets all localization entries from this bundle.
HeaderDictionary getUnlocalizedAttributes ()
 
Returns:
the (raw/unlocalized) attributes

long getBundleId ()
 Get bundle identifier for this bundle archive.
String getBundleLocation ()
 Get bundle location for this bundle archive.
int getStartLevel ()
 Get stored bundle start level.
void setStartLevel (int level) throws IOException
 Set stored bundle start level.
byte[] getClassBytes (Integer sub, String component) throws IOException
 Get a byte array containg the contents of named file from a bundle archive.
Vector componentExists (String component, boolean onlyFirst)
 Check if named entry exists in the bundle's classpath.
InputStream getInputStream (String component, int ix)
 Get an specific InputStream to named entry inside a bundle.
String getNativeLibrary (String libName)
 Extract native library from JAR.
boolean getStartOnLaunchFlag ()
 Get state of start-on-launch flag.
void setStartOnLaunchFlag (boolean value) throws IOException
 Set state of start-on-launch flag.
void purge ()
 Remove bundle archive from persistent storage.
void close ()
 Close archive and all its open files.
List getFailedClassPathEntries ()
 Get a list with all classpath entries we failed to locate.
Enumeration findResourcesPath (String path)
 Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.
String getJarLocation ()
 
Returns:
the location of the cached bundle.


Package Functions

String getAttribute (String key)
 Get an attribute from the manifest of a bundle.

Member Function Documentation

String org.knopflerfish.framework.BundleArchive.getAttribute ( String  key  )  [package]

Get an attribute from the manifest of a bundle.

Not localized

Parameters:
key Name of attribute to get.
Returns:
A string with result or null if the entry doesn't exists.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleImpl.doExportImport().

Hashtable org.knopflerfish.framework.BundleArchive.getLocalizationEntries ( String  localeFile  ) 

Gets all localization entries from this bundle.

Will typically read the file OSGI-INF/bundle_<locale>.properties.

Parameters:
localeFile Filename within archive for localization properties.
Returns:
null or a mapping of the entries.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleClassLoader.getLocalizationEntries(), org.knopflerfish.framework.SystemBundle.readLocalization(), and org.knopflerfish.framework.BundleImpl.readLocalization().

long org.knopflerfish.framework.BundleArchive.getBundleId (  ) 

Get bundle identifier for this bundle archive.

Returns:
Bundle identifier.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleImpl.BundleImpl(), org.knopflerfish.framework.BundleClassLoader.getBundleArchive(), org.knopflerfish.framework.bundlestorage.memory.BundleStorageImpl.removeArchive(), org.knopflerfish.framework.bundlestorage.file.BundleStorageImpl.removeArchive(), and org.knopflerfish.framework.BundleClassLoader.searchFor().

String org.knopflerfish.framework.BundleArchive.getBundleLocation (  ) 

Get bundle location for this bundle archive.

Returns:
Bundle location.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleImpl.BundleImpl(), org.knopflerfish.framework.bundlestorage.memory.BundleStorageImpl.getStartOnLaunchBundles(), org.knopflerfish.framework.bundlestorage.file.BundleStorageImpl.getStartOnLaunchBundles(), and org.knopflerfish.framework.BundleClassLoader.purge().

byte [] org.knopflerfish.framework.BundleArchive.getClassBytes ( Integer  sub,
String  component 
) throws IOException

Get a byte array containg the contents of named file from a bundle archive.

Parameters:
Integer From which sub archive to get.
component File to get.
Returns:
Byte array with contents of file or null if file doesn't exist.
Exceptions:
IOException if failed to read jar entry.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Vector org.knopflerfish.framework.BundleArchive.componentExists ( String  component,
boolean  onlyFirst 
)

Check if named entry exists in the bundle's classpath.

Leading '/' is stripped.

Parameters:
component Entry to get reference to.
onlyFirst End search when we find first entry if this is true.
Returns:
Vector of classpath entry numbers, or null if it doesn't exist.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleClassLoader.searchFor().

InputStream org.knopflerfish.framework.BundleArchive.getInputStream ( String  component,
int  ix 
)

Get an specific InputStream to named entry inside a bundle.

Leading '/' is stripped.

Parameters:
component Entry to get reference to.
ix index of sub archives. A postive number is the classpath entry index. -1 means look in the main bundle.
Returns:
InputStream to entry or null if it doesn't exist.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

String org.knopflerfish.framework.BundleArchive.getNativeLibrary ( String  libName  ) 

Extract native library from JAR.

Parameters:
libName Name of Jar file to get.
Returns:
A string with path to native library.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleClassLoader.findLibrary().

boolean org.knopflerfish.framework.BundleArchive.getStartOnLaunchFlag (  ) 

Get state of start-on-launch flag.

Returns:
Boolean value for start on launch flag.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.bundlestorage.memory.BundleStorageImpl.getStartOnLaunchBundles(), and org.knopflerfish.framework.bundlestorage.file.BundleStorageImpl.getStartOnLaunchBundles().

void org.knopflerfish.framework.BundleArchive.setStartOnLaunchFlag ( boolean  value  )  throws IOException

Set state of start-on-launch flag.

Parameters:
value Boolean value for start on launch flag.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleImpl.startOnLaunch().

List org.knopflerfish.framework.BundleArchive.getFailedClassPathEntries (  ) 

Get a list with all classpath entries we failed to locate.

Returns:
A List with all failed classpath entries, null if no failures.

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.

Referenced by org.knopflerfish.framework.BundleImpl.getUpdatedState().

Enumeration org.knopflerfish.framework.BundleArchive.findResourcesPath ( String  path  ) 

Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.

Parameters:
name 
Returns:

Implemented in org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl, and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.


The documentation for this interface was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4