|
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.DefaultPlatform
A default Platform class for SMF. This class is used to provide platform specific support for SMF in an environment which supports a file system. The file system must support long file names.
Constructor Summary | |
DefaultPlatform(java.lang.String[] args)
Constructor for DefaultPlatform. |
Method Summary | |
void |
compactStorage()
Clean up 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 for the 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. |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultPlatform(java.lang.String[] args)
No blank spaces should be used in the arguments to the DefaultPlatform. The options that DefaultPlatform recognizes and handles are:
An
- array of strings containing arguments.
This object cannot be used until initialize is called.Method Detail |
public void initialize(Framework framework)
initialize
in interface Platform
framework
- The Framework object that this Platform
object is supporting.public java.util.Properties getProperties()
getProperties
in interface Platform
public void initializeStorage() throws java.io.IOException
This method initializes the bundle persistent storage area. If a dir was specified in the -platform command line option, then it is used. If not, if the property com.ibm.osg.smf.bundledir is specifed, its value will be used as the name of the bundle directory instead of ./bundles. If reset was specified on the -platform command line option, then the storage will be cleared.
initializeStorage
in interface Platform
java.io.IOException
- If an error occurs initializing the storage.public void compactStorage()
Cleans up any deferred deletions in persistent storage.
compactStorage
in interface Platform
public java.net.URLConnection mapLocationToURLConnection(java.lang.String location) throws org.osgi.framework.BundleException
This methods treats the location string as a URL.
mapLocationToURLConnection
in interface Platform
location
- of the bundle.org.osgi.framework.BundleException
- if the mapping fails.public java.util.Vector getInstalledBundles()
getInstalledBundles
in interface Platform
public int getStatus(org.osgi.framework.Bundle bundle)
getStatus
in interface Platform
bundle
- Bundle to retrieve status for.public void setStatus(org.osgi.framework.Bundle bundle, int status) throws org.osgi.framework.BundleException
setStatus
in interface Platform
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
getMetadata
in interface Platform
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
setMetadata
in interface Platform
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.
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 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 update.source
- URLConnection from which the bundle may be read.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.
uninstallBundle
in interface Platform
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.
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.
getDataFile
in interface Platform
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)
findLibrary
in interface Platform
bundle
- The bundle.name
- The library name requested by Runtime.loadLibrary().public PermissionStorage getPermissionStorage() throws java.io.IOException
The PermissionStorage object will store permission data in the "permdata" subdirectory of the bundle storage directory assigned by initializeStorage.
getPermissionStorage
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 space
|
Service Management Framework Release 3.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |