org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl Class Reference

Inheritance diagram for org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl:

org.knopflerfish.framework.BundleArchive

List of all members.


Detailed Description

Interface for managing bundle data.

Author:
Jan Stein

Philippe Laporte

Version:
Revision
1.2

Definition at line 57 of file memory/BundleArchiveImpl.java.


Public Member Functions

String getAttribute (String key)
 Get an attribute from the manifest of a bundle.
Hashtable getLocalizationEntries (String localeFile)
 returns the localization entries of this archive.
HeaderDictionary getUnlocalizedAttributes ()
 returns the raw unlocalized entries of this archive.
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)
 Set stored bundle start level.
byte[] getClassBytes (Integer sub, String path) 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 exist in bundles classpath.
InputStream getInputStream (String component, int ix)
 Get an specific InputStream to named entry inside a bundle.
String getNativeLibrary (String libName)
 Get 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 for further access.
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

 BundleArchiveImpl (BundleStorageImpl bundleStorage, InputStream is, String bundleLocation, long bundleId) throws Exception
 Construct new bundle archive.
 BundleArchiveImpl (BundleArchiveImpl old, InputStream is) throws Exception
 Construct new bundle archive in an existing bundle archive.

Member Function Documentation

String org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getAttribute ( String  key  ) 

Get an attribute from the manifest of a bundle.

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

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 120 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.getAttribute().

long org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getBundleId (  ) 

Get bundle identifier for this bundle archive.

Returns:
Bundle identifier.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 158 of file memory/BundleArchiveImpl.java.

String org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getBundleLocation (  ) 

Get bundle location for this bundle archive.

Returns:
Bundle location.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 167 of file memory/BundleArchiveImpl.java.

byte [] org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getClassBytes ( Integer  sub,
String  path 
) throws IOException

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

Parameters:
sub index of jar, 0 means the top level.
path Path to class file.
Returns:
Byte array with contents of file or null if file doesn't exist.
Exceptions:
IOException if failed to read jar entry.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 211 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.getClassBytes().

Vector org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.componentExists ( String  component,
boolean  onlyFirst 
)

Check if named entry exist in bundles 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 or entry numbers, or null if it doesn't exist.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 224 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.getInputStream().

InputStream org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.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.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 257 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.getInputStream().

String org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getNativeLibrary ( String  libName  ) 

Get native library from JAR.

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

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 276 of file memory/BundleArchiveImpl.java.

boolean org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getStartOnLaunchFlag (  ) 

Get state of start on launch flag.

Returns:
Boolean value for start on launch flag.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 286 of file memory/BundleArchiveImpl.java.

void org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.setStartOnLaunchFlag ( boolean  value  )  throws IOException

Set state of start on launch flag.

Parameters:
value Boolean value for start on launch flag.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 296 of file memory/BundleArchiveImpl.java.

void org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.purge (  ) 

Remove bundle archive from persistent storage.

If we removed the active revision also remove bundle status files.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 307 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.BundleStorageImpl.removeArchive().

void org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.close (  ) 

Close archive for further access.

It should still be possible to get attributes.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 316 of file memory/BundleArchiveImpl.java.

List org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getFailedClassPathEntries (  ) 

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

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

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 325 of file memory/BundleArchiveImpl.java.

Enumeration org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.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:

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 369 of file memory/BundleArchiveImpl.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.findResourcesPath().


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