|
Service Management Framework Release 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.osg.smf.platform.flash.FlashBundleStore
Provides an implementation of a Bundle Store which stores bundles and bundle information in Flash memory.
The options that the FlashBundleStore recognizes and handles are:
(c) Copyright IBM Corp. 1999, 2002
Field Summary | |
static java.lang.String |
DATA_DIR
The name of the data subdirectory in the bundles local store. |
static java.lang.String |
DEFAULT_FLASH_FILE
|
static int |
DEFAULT_FLASH_FILE_SIZE_MB
|
Constructor Summary | |
FlashBundleStore(java.lang.String[] args)
Creates and prepares the flash bundle store according to the options. |
Method Summary | |
void |
compactStorage()
Cleans the persistent storage. |
java.lang.String |
findLibrary(org.osgi.framework.Bundle bundle,
java.lang.String name)
Returns the absolute path name of a native library or null if not found. |
java.io.File |
getDataFile(org.osgi.framework.Bundle bundle,
java.lang.String filename)
Creates a File object for a file in the persistent storage area
provided for the bundle by the framework. |
java.util.Vector |
getInstalledBundles()
Returns an array of all installed Bundle s. |
java.lang.String |
getMetadata(org.osgi.framework.Bundle bundle)
Returns the metadata string for a bundle. |
PermissionStorage |
getPermissionStorage()
Returns the PermissionStorage object which will be used to to manage the permission data. |
java.util.Properties |
getProperties()
Returns the properties object for the platform. |
int |
getStatus(org.osgi.framework.Bundle bundle)
Returns the given bundle's status as recorded in the bundle management information. |
long |
getTotalFreeSpace()
Returns the total amount of free space available for bundle storage on the device. |
void |
initialize(Framework fw)
Initializes the Platform object so that it is ready to be called by the framework. |
void |
initializeStorage()
Initializes the bundle's data storage. |
BundleStorage |
installBundle(java.lang.String location,
java.net.URLConnection source)
Prepares to install a bundle from a URLConnection. |
java.net.URLConnection |
mapLocationToURLConnection(java.lang.String location)
Maps a location to an InputStream. |
void |
setMetadata(org.osgi.framework.Bundle bundle,
java.lang.String metadata)
Set the metadata for a bundle. |
void |
setStatus(org.osgi.framework.Bundle bundle,
int newStatus)
Updates the status of the given bundle. |
BundleStorage |
uninstallBundle(org.osgi.framework.Bundle bundle)
Prepares to uninstall a bundle. |
BundleStorage |
updateBundle(org.osgi.framework.Bundle bundle,
java.net.URLConnection source)
Prepares to update a bundle from a URLConnection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DATA_DIR
public static final java.lang.String DEFAULT_FLASH_FILE
public static final int DEFAULT_FLASH_FILE_SIZE_MB
Constructor Detail |
public FlashBundleStore(java.lang.String[] args)
An
- array of strings containing arguments in the form of key=value pairs.Method Detail |
public void initialize(Framework fw)
initialize
in interface Platform
framework
- The Framework object that this Platform
object is supporting.public void initializeStorage()
initializeStorage
in interface Platform
com.ibm.osg.smf.platform.Platform
java.io.IOException
- If the platform is unable to
initialize the bundle storage.public void compactStorage()
compactStorage
in interface Platform
public java.lang.String findLibrary(org.osgi.framework.Bundle bundle, java.lang.String name)
null
if not found.findLibrary
in interface Platform
bundle
- the bundlename
- the library namepublic java.io.File getDataFile(org.osgi.framework.Bundle bundle, java.lang.String filename)
File
object for a file in the persistent storage area
provided for the bundle by the framework.
If the platform does not have file system support, this method will return
null
.getDataFile
in interface Platform
bundle
- the bundlefilename
- the path name of the filepublic int getStatus(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
getStatus
in interface Platform
bundle
- the bundle whose status is requiredorg.osgi.framework.BundleException
- if the status for the given bundle cannot be retrievedpublic java.lang.String getMetadata(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
getMetadata
in interface Platform
bundle
- the bundle to retrieve metadata fororg.osgi.framework.BundleException
- if the methods fails.public java.util.Vector getInstalledBundles()
Bundle
s.getInstalledBundles
in interface Platform
com.ibm.osg.smf.platform.Platform
public PermissionStorage getPermissionStorage() throws java.io.IOException
The PermissionStorage object will store permission data in the flash master element .
getPermissionStorage
in interface Platform
public java.util.Properties getProperties()
getProperties
in interface Platform
public long getTotalFreeSpace() throws java.io.IOException
getTotalFreeSpace
in interface Platform
java.io.IOException
- if an I/O error occurs determining the available spacepublic BundleStorage installBundle(java.lang.String location, java.net.URLConnection source) throws org.osgi.framework.BundleException
To complete the install, modify and then commit will be called on the returned BundleStorage object. If either of these methods throw a BundleException or some other error occurs, then undo will be called on the BundleStorage object to undo the change to persistent storage.
installBundle
in interface Platform
location
- Bundle location.source
- URLConnection from which the bundle may be read.org.osgi.framework.BundleException
- if the install preparation fails.public java.net.URLConnection mapLocationToURLConnection(java.lang.String location) throws org.osgi.framework.BundleException
mapLocationToURLConnection
in interface Platform
location
- of the bundle.org.osgi.framework.BundleException
- if the mapping failspublic void setStatus(org.osgi.framework.Bundle bundle, int newStatus) throws org.osgi.framework.BundleException
setStatus
in interface Platform
bundle
- the com.ibm.osg.smf.Bundle whose status is to be setnewStatus
- the Bundle's statusorg.osgi.framework.BundleException
- if there is a problem updating the store's tables to reflect
the change in bundle statuspublic void setMetadata(org.osgi.framework.Bundle bundle, java.lang.String metadata) throws org.osgi.framework.BundleException
setMetadata
in interface Platform
bundle
- Bundle to save metadata formetadata
- Bundle's metadata stringorg.osgi.framework.BundleException
- if the methods fails.java.lang.NullPointerException
- if the metadata is null.public BundleStorage uninstallBundle(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
To complete the uninstall, modify and then commit will be called on the returned BundleStorage object. If either of these methods throw a BundleException or some other error occurs, then undo will be called on the BundleStorage object to undo the change to persistent storage.
uninstallBundle
in interface Platform
bundle
- Bundle to uninstall.org.osgi.framework.BundleException
- if the uninstall preparation fails.public BundleStorage updateBundle(org.osgi.framework.Bundle bundle, java.net.URLConnection source) throws org.osgi.framework.BundleException
To complete the update, modify and then commit will be called on the returned BundleStorage object. If either of these methods throw a BundleException or some other error occurs, then undo will be called on the BundleStorage object to undo the change to persistent storage.
updateBundle
in interface Platform
bundle
- Bundle to updatesource
- URLConnection from which the bundle may be readorg.osgi.framework.BundleException
- if the update preparation fails.
|
Service Management Framework Release 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |