|
Service Management Framework Release 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Platform interface to SMF. This class is used to provide platform specific support for SMF.
SMF will call this class to perform platform specific functions. Classes that implement Platform MUST provide a constructor that takes as a parameter an array of Strings. This array will contain arguments to be handled by the Platform. The Platform implementation may define the format and content of its arguments. The constructor should parse the arguments passed to it and remember them. The initialize method should perform the actual processing of the platform arguments.
Method Summary | |
void |
compactStorage()
Compact/cleanup the persistent storage for the platform. |
java.lang.String |
findLibrary(org.osgi.framework.Bundle bundle,
java.lang.String name)
Returns the absolute path name of a native library for a bundle. |
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()
Return a list of the installed bundles. |
java.lang.String |
getMetadata(org.osgi.framework.Bundle bundle)
Get 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()
Return the properties object for the platform. |
int |
getStatus(org.osgi.framework.Bundle bundle)
Get the status data for a bundle. |
long |
getTotalFreeSpace()
Returns the total amount of free space available for bundle storage on the device. |
void |
initialize(Framework framework)
Initialize the Platform object so that it is ready to be called by the framework. |
void |
initializeStorage()
Initialize the persistent storage for the platform. |
BundleStorage |
installBundle(java.lang.String location,
java.net.URLConnection source)
Prepare to install a bundle from a URLConnection. |
java.net.URLConnection |
mapLocationToURLConnection(java.lang.String location)
Map a location to a URLConnection. |
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 status)
Set the status data for a bundle. |
BundleStorage |
uninstallBundle(org.osgi.framework.Bundle bundle)
Prepare to uninstall a bundle. |
BundleStorage |
updateBundle(org.osgi.framework.Bundle bundle,
java.net.URLConnection source)
Prepare to update a bundle from a URLConnection. |
Method Detail |
public void initialize(Framework framework)
framework
- The Framework object that this Platform
object is supporting.public void initializeStorage() throws java.io.IOException
java.io.IOException
- If the platform is unable to
initialize the bundle storage.public void compactStorage()
public java.util.Properties getProperties()
public java.net.URLConnection mapLocationToURLConnection(java.lang.String location) throws org.osgi.framework.BundleException
location
- of the bundle.org.osgi.framework.BundleException
- if the mapping fails.public java.util.Vector getInstalledBundles()
public int getStatus(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
bundle
- Bundle to retrieve status for.org.osgi.framework.BundleException
- if the methods fails.public void setStatus(org.osgi.framework.Bundle bundle, int status) throws org.osgi.framework.BundleException
bundle
- Bundle to save status for.status
- Bundle's status.org.osgi.framework.BundleException
- if the methods fails.public java.lang.String getMetadata(org.osgi.framework.Bundle bundle) throws org.osgi.framework.BundleException
bundle
- Bundle to retrieve metadata for.org.osgi.framework.BundleException
- if the methods fails.public void setMetadata(org.osgi.framework.Bundle bundle, java.lang.String metadata) throws org.osgi.framework.BundleException
bundle
- Bundle to save metadata for.metadata
- Bundle's metadata string.org.osgi.framework.BundleException
- if the methods fails.java.lang.NullPointerException
- if the metadata is null.public 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.
location
- Bundle location.source
- URLConnection from which the bundle may be read.
Any InputStreams returned from the source
(URLConnections.getInputStream) must be closed by the
BundleStorage object.org.osgi.framework.BundleException
- if the install 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.
bundle
- Bundle to update.source
- URLConnection from which the updated bundle may be read.
Any InputStreams returned from the source
(URLConnections.getInputStream) must be closed by the
BundleStorage object.org.osgi.framework.BundleException
- if the update preparation fails.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.
bundle
- Bundle to uninstall.org.osgi.framework.BundleException
- if the uninstall preparation fails.public 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
.
A File
object for the base directory of the
persistent storage area
can be obtained by calling this method with the empty string ("")
as the parameter.
bundle
- The bundle.filename
- The relative name of the desired file.public java.lang.String findLibrary(org.osgi.framework.Bundle bundle, java.lang.String name)
bundle
- The bundle.name
- The library name requested by Runtime.loadLibrary().public PermissionStorage getPermissionStorage() throws java.io.IOException
public long getTotalFreeSpace() throws java.io.IOException
java.io.IOException
- if an I/O error occurs determining the available space
|
Service Management Framework Release 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |