@ConsumerType
public interface ModuleConnector
ModuleConnector provides connections to instances of
ConnectModule that are used by a Framework instance to
connect installed bundles locations with content provided by the
ModuleConnector.
This allows a ModuleConnector to provide content and classes for a
connected bundle installed in the Framework. A
ModuleConnector is provided when
creating a
framework instance. Because a ModuleConnector instance can
participate in the initialization of the Framework and the life cycle
of a Framework instance the ModuleConnector instance should
only be used with a single Framework instance at a time.
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<ConnectModule> |
connect(java.lang.String location)
Connects a bundle location with a
ConnectModule. |
void |
initialize(java.io.File storage,
java.util.Map<java.lang.String,java.lang.String> configuration)
Initializes this
ModuleConnector with the
framework persistent storage file and
framework properties configured for a Framework instance. |
java.util.Optional<BundleActivator> |
newBundleActivator()
Creates a new activator for this
ModuleConnector. |
void initialize(java.io.File storage,
java.util.Map<java.lang.String,java.lang.String> configuration)
ModuleConnector with the
framework persistent storage file and
framework properties configured for a Framework instance.
This method is called once by a Framework instance and is called
before any other methods on this module connector are called.
storage - The persistent storage area used by the Framework
or null if the platform does not have file system
support.configuration - An unmodifiable map of framework configuration
properties that were used to configure the new framework
instance.java.util.Optional<ConnectModule> connect(java.lang.String location) throws BundleException
ConnectModule.
When the result is empty, then the framework must handle reading the
content of the bundle itself. Otherwise, the returned
ConnectModule must be used by the framework to access the content
of the bundle.
location - The bundle location used to install a bundle.Optional containing the ConnectModule for the
specified bundle location, or an empty Optional if the
framework must handle reading the content of the bundle itself.BundleException - If the location cannot be handled.java.util.Optional<BundleActivator> newBundleActivator()
ModuleConnector.
This method is called by the framework during framework
initialization. Returning an
activator allows this ModuleConnector to participate in the
framework life cycle. If an activator is returned:
Optional containing a new BundleActivator for
this ModuleConnector, or an empty Optional if no
BundleActivator is necessary.Copyright © OSGi Alliance (2000, 2020). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0