public interface ExtensionManager
extension models available in the current context and their state.
This class is also the access point to obtaining configuration instances
of the extensions in use.
For an extension to be usable, it has to be registered in this manager through the
registerExtension(ExtensionManifest, ClassLoader) method| Modifier and Type | Method and Description |
|---|---|
ConfigurationInstance |
getConfiguration(ExtensionModel extensionModel,
org.mule.runtime.api.message.MuleEvent muleEvent)
Returns a
ConfigurationInstance for the given extensionModel. |
ConfigurationInstance |
getConfiguration(String configurationProviderName,
org.mule.runtime.api.message.MuleEvent muleEvent)
Returns a
ConfigurationInstance obtained through a previously registered
ConfigurationProvider named as configurationProvider
After the ConfigurationProvider has been located, an instance is returned by
invoking its ConfigurationProvider.get(Object) with the muleEvent
as the argument. |
Optional<RuntimeExtensionModel> |
getExtension(String extensionName)
|
Set<RuntimeExtensionModel> |
getExtensions()
Returns an immutable
Set listing all the discovered
extensionModels. |
void |
registerExtension(ExtensionManifest manifest,
ClassLoader classLoader) |
void registerExtension(ExtensionManifest manifest, ClassLoader classLoader)
Set<RuntimeExtensionModel> getExtensions()
Set listing all the discovered
extensionModels.Set. Will not be null but might be emptyOptional<RuntimeExtensionModel> getExtension(String extensionName)
extensionName - the name of the extensions you want.Optional. It will be empty if no such extension is registeredConfigurationInstance getConfiguration(String configurationProviderName, org.mule.runtime.api.message.MuleEvent muleEvent)
ConfigurationInstance obtained through a previously registered
ConfigurationProvider named as configurationProvider
After the ConfigurationProvider has been located, an instance is returned by
invoking its ConfigurationProvider.get(Object) with the muleEvent
as the argument.
By the mere fact of this configuration being returned, the value of
ConfigurationStats.getLastUsedMillis() will be updated for the returned
ConfigurationInstanceconfigurationProviderName - the name of a previously registered ConfigurationProvidermuleEvent - the current MuleEventConfigurationInstanceConfigurationInstance getConfiguration(ExtensionModel extensionModel, org.mule.runtime.api.message.MuleEvent muleEvent)
ConfigurationInstance for the given extensionModel.
Because no ConfigurationProvider is specified, the following algorithm will
be applied to try and determine the instance to be returned:
ConfigurationProvider is registered, capable of handing configurations
of the given extensionModel, then that provider is usedConfigurationProvider meeting the criteria above is found, then
a IllegalStateException is thrownConfigurationProvider is registered, then an attempt will be made
to locate a ConfigurationModel for which an implicit configuration can be inferred. A model
can be considered implicit if all its parameters are either optional or provide a default value. If such
a model is found, then a ConfigurationProvider is created and registered for that model.
IllegalStateException is thrownConfigurationStats.getLastUsedMillis() will be updated for the returned
ConfigurationInstanceextensionModel - the ExtensionModel for which a configuration is wantedmuleEvent - the current MuleEventConfigurationInstanceIllegalStateException - if none or too many ConfigurationProvider are found to be suitableCopyright © 2016 MuleSoft, Inc.. All rights reserved.