|
|||||||||
| Home >> All >> org >> eclipse >> osgi >> framework >> [ adaptor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.osgi.framework.adaptor
Interface FrameworkAdaptor

- public interface FrameworkAdaptor
FrameworkAdaptor interface to the osgi framework. This class is used to provide platform specific support for the osgi framework.
The OSGi framework will call this class to perform platform specific functions. Classes that implement FrameworkAdaptor MUST provide a constructor that takes as a parameter an array of Strings. This array will contain arguments to be handled by the FrameworkAdaptor. The FrameworkAdaptor 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 adaptor arguments.
| Field Summary | |
static java.lang.String |
FRAMEWORK_SYMBOLICNAME
|
| Method Summary | |
void |
compactStorage()
Compact/cleanup the persistent storage for the adaptor. |
BundleData |
createSystemBundleData()
Creates a BundleData object for the System Bundle. |
void |
frameworkStart(org.osgi.framework.BundleContext context)
The framework will call this method after the System BundleActivator.start(BundleContext) has been called. |
void |
frameworkStop(org.osgi.framework.BundleContext context)
The framework will call this method before the System BundleActivator.stop(BundleContext) has been called. |
void |
frameworkStopping(org.osgi.framework.BundleContext context)
The framework will call this method before the process of framework shutdown is started. |
java.lang.ClassLoader |
getBundleClassLoaderParent()
Returns the parent ClassLoader all BundleClassLoaders created. |
BundleWatcher |
getBundleWatcher()
Returns the bundle watcher for this FrameworkAdaptor. |
java.lang.String |
getExportPackages()
Gets the value for Export-Package for packages that a FrameworkAdaptor is exporting to the framework. |
java.lang.String |
getExportServices()
Gets any Service class names that a FrameworkAdaptor is exporting to the framework. |
org.eclipse.osgi.framework.log.FrameworkLog |
getFrameworkLog()
Returns the FrameworkLog for the FrameworkAdaptor. |
int |
getInitialBundleStartLevel()
Returns the initial bundle start level as maintained by this adaptor |
BundleData[] |
getInstalledBundles()
Return a list of the installed bundles. |
PermissionStorage |
getPermissionStorage()
Returns the PermissionStorage object which will be used to to manage the permission data. |
org.eclipse.osgi.service.resolver.PlatformAdmin |
getPlatformAdmin()
Returns the PlatformAdmin for this FrameworkAdaptor. |
java.util.Properties |
getProperties()
Return the properties object for the adaptor. |
java.lang.String |
getProvidePackages()
Gets the value for Provide-Package for packages that a FrameworkAdaptor is exporting to the framework. |
ServiceRegistry |
getServiceRegistry()
Returns the ServiceRegistry object which will be used
to manage ServiceReference bindings. |
org.eclipse.osgi.service.resolver.State |
getState()
Returns the State for this FrameworkAdaptor. |
long |
getTotalFreeSpace()
Returns the total amount of free space available for bundle storage on the device. |
void |
handleRuntimeError(java.lang.Throwable error)
Handles a RuntimeException or Error that was caught by the Framework and there is not a suitable caller to propagate the Throwable to. |
void |
initialize(EventPublisher eventPublisher)
Initialize the FrameworkAdaptor object so that it is ready to be called by the framework. |
void |
initializeStorage()
Initialize the persistent storage for the adaptor. |
BundleOperation |
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 |
setInitialBundleStartLevel(int value)
Sets the initial bundle start level |
BundleOperation |
uninstallBundle(BundleData bundledata)
Prepare to uninstall a bundle. |
BundleOperation |
updateBundle(BundleData bundledata,
java.net.URLConnection source)
Prepare to update a bundle from a URLConnection. |
| Field Detail |
FRAMEWORK_SYMBOLICNAME
public static final java.lang.String FRAMEWORK_SYMBOLICNAME
- See Also:
- Constant Field Values
| Method Detail |
initialize
public void initialize(EventPublisher eventPublisher)
- Initialize the FrameworkAdaptor object so that it is ready to be
called by the framework. Handle the arguments that were
passed to the constructor.
This method must be called before any other FrameworkAdaptor methods.
initializeStorage
public void initializeStorage()
throws java.io.IOException
- Initialize the persistent storage for the adaptor.
compactStorage
public void compactStorage()
throws java.io.IOException
- Compact/cleanup the persistent storage for the adaptor.
getProperties
public java.util.Properties getProperties()
- Return the properties object for the adaptor.
The properties in the returned object supplement
the System properties.
The framework may modify this object. The Framework
will use the returned properties to set the System
properties.
getInstalledBundles
public BundleData[] getInstalledBundles()
- Return a list of the installed bundles. Each element in the
list must be of type
BundleData. EachBundleDatacorresponds to one bundle that is persitently stored. This method must constructBundleDataobjects for all installed bundles and return a Vector containing the objects. The returned Vector becomes the property of the framework.
mapLocationToURLConnection
public java.net.URLConnection mapLocationToURLConnection(java.lang.String location) throws org.osgi.framework.BundleException
- Map a location to a URLConnection. This is used by the Framework when installing a bundle
from a spacified location.
installBundle
public BundleOperation installBundle(java.lang.String location, java.net.URLConnection source)
- Prepare to install a bundle from a URLConnection.
To complete the install, begin and then commit must be called on the returned
BundleOperationobject. If either of these methods throw a BundleException or some other error occurs, then undo must be called on theBundleOperationobject to undo the change to persistent storage.
updateBundle
public BundleOperation updateBundle(BundleData bundledata, java.net.URLConnection source)
- Prepare to update a bundle from a URLConnection.
To complete the update begin and then commit must be called on the returned
BundleOperationobject. If either of these methods throw a BundleException or some other error occurs, then undo must be called on theBundleOperationobject to undo the change to persistent storage.
uninstallBundle
public BundleOperation uninstallBundle(BundleData bundledata)
- Prepare to uninstall a bundle.
To complete the uninstall, begin and then commit must be called on the returned
BundleOperationobject. If either of these methods throw a BundleException or some other error occurs, then undo must be called on theBundleOperationobject to undo the change to persistent storage.
getTotalFreeSpace
public long getTotalFreeSpace()
throws java.io.IOException
- Returns the total amount of free space available for bundle storage on the device.
getPermissionStorage
public PermissionStorage getPermissionStorage() throws java.io.IOException
- Returns the PermissionStorage object which will be used to
to manage the permission data.
getServiceRegistry
public ServiceRegistry getServiceRegistry()
- Returns the
ServiceRegistryobject which will be used to manage ServiceReference bindings.
frameworkStart
public void frameworkStart(org.osgi.framework.BundleContext context) throws org.osgi.framework.BundleException
- The framework will call this method after the
System BundleActivator.start(BundleContext) has been called. The context is
the System Bundle's BundleContext. This method allows FrameworkAdaptors to
have access to the OSGi framework to get services, register services and
perform other OSGi operations.
frameworkStop
public void frameworkStop(org.osgi.framework.BundleContext context) throws org.osgi.framework.BundleException
- The framework will call this method before the
System BundleActivator.stop(BundleContext) has been called. The context is
the System Bundle's BundleContext. This method allows FrameworkAdaptors to
have access to the OSGi framework to get services, register services and
perform other OSGi operations.
frameworkStopping
public void frameworkStopping(org.osgi.framework.BundleContext context)
- The framework will call this method before the process of framework
shutdown is started. This gives FrameworkAdaptors a chance to
perform actions before the framework start level is decremented and
all the bundles are stopped. This method will get called before the
frameworkStop(BundleContext)55 method.
getExportPackages
public java.lang.String getExportPackages()
- Gets the value for Export-Package for packages that a FrameworkAdaptor is exporting
to the framework. The String returned will be parsed by the framework
and the packages specified will be exported by the System Bundle.
getProvidePackages
public java.lang.String getProvidePackages()
- Gets the value for Provide-Package for packages that a FrameworkAdaptor is exporting
to the framework. The String returned will be parsed by the framework
and the packages specified will be exported by the System Bundle.
getExportServices
public java.lang.String getExportServices()
- Gets any Service class names that a FrameworkAdaptor is exporting to the
framework. The class names returned will be exported by the System Bundle.
getInitialBundleStartLevel
public int getInitialBundleStartLevel()
- Returns the initial bundle start level as maintained by this adaptor
setInitialBundleStartLevel
public void setInitialBundleStartLevel(int value)
- Sets the initial bundle start level
getFrameworkLog
public org.eclipse.osgi.framework.log.FrameworkLog getFrameworkLog()
- Returns the FrameworkLog for the FrameworkAdaptor. The FrameworkLog
is used by the Framework and FrameworkAdaptor to log any error messages
and FramworkEvents of type ERROR.
createSystemBundleData
public BundleData createSystemBundleData() throws org.osgi.framework.BundleException
- Creates a BundleData object for the System Bundle. The BundleData
returned will be used to define the System Bundle for the Framework.
getBundleWatcher
public BundleWatcher getBundleWatcher()
- Returns the bundle watcher for this FrameworkAdaptor.
getPlatformAdmin
public org.eclipse.osgi.service.resolver.PlatformAdmin getPlatformAdmin()
- Returns the PlatformAdmin for this FrameworkAdaptor.
getState
public org.eclipse.osgi.service.resolver.State getState()
- Returns the State for this FrameworkAdaptor.
getBundleClassLoaderParent
public java.lang.ClassLoader getBundleClassLoaderParent()
- Returns the parent ClassLoader all BundleClassLoaders created. All
BundleClassLoaders that are created must use the ClassLoader returned
by this method as a parent ClassLoader. Each call to this method must
return the same ClassLoader object.
handleRuntimeError
public void handleRuntimeError(java.lang.Throwable error)
- Handles a RuntimeException or Error that was caught by the Framework and
there is not a suitable caller to propagate the Throwable to. This gives
the FrameworkAdaptor the ablity to handle such cases. For example, a
FrameworkAdaptor may decide that such unexpected errors should cause an error
message to be logged, or that the Framework should be terminated immediately.
|
|||||||||
| Home >> All >> org >> eclipse >> osgi >> framework >> [ adaptor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC