Interface ModuleConnector
-
@ConsumerType public interface ModuleConnector
AModuleConnectorprovides connections to instances ofConnectModulethat are used by aFrameworkinstance to connect installed bundles locations with content provided by theModuleConnector.This allows a
ModuleConnectorto provide content and classes for a connected bundle installed in theFramework. AModuleConnectoris provided whencreatinga framework instance. Because aModuleConnectorinstance can participate in the initialization of theFrameworkand the life cycle of aFrameworkinstance theModuleConnectorinstance should only be used with a singleFrameworkinstance at a time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ConnectModule>connect(java.lang.String location)Connects a bundle location with aConnectModule.voidinitialize(java.io.File storage, java.util.Map<java.lang.String,java.lang.String> configuration)Initializes thisModuleConnectorwith theframework persistent storagefile and framework properties configured for aFrameworkinstance.java.util.Optional<BundleActivator>newBundleActivator()Creates a new activator for thisModuleConnector.
-
-
-
Method Detail
-
initialize
void initialize(java.io.File storage, java.util.Map<java.lang.String,java.lang.String> configuration)Initializes thisModuleConnectorwith theframework persistent storagefile and framework properties configured for aFrameworkinstance.This method is called once by a
Frameworkinstance and is called before any other methods on this module connector are called.- Parameters:
storage- The persistent storage area used by theFrameworkornullif 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.
-
connect
java.util.Optional<ConnectModule> connect(java.lang.String location) throws BundleException
Connects a bundle location with aConnectModule.When the result is empty, then the framework must handle reading the content of the bundle itself. Otherwise, the returned
ConnectModulemust be used by the framework to access the content of the bundle.- Parameters:
location- The bundle location used to install a bundle.- Returns:
- An
Optionalcontaining theConnectModulefor the specified bundle location, or an emptyOptionalif the framework must handle reading the content of the bundle itself. - Throws:
BundleException- If the location cannot be handled.
-
newBundleActivator
java.util.Optional<BundleActivator> newBundleActivator()
Creates a new activator for thisModuleConnector.This method is called by the framework during framework
initialization. Returning an activator allows thisModuleConnectorto participate in the framework life cycle. If an activator is returned:- Returns:
- An
Optionalcontaining a newBundleActivatorfor thisModuleConnector, or an emptyOptionalif noBundleActivatoris necessary.
-
-