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(ExtensionModel)
method
| Modifier and Type | Method and Description |
|---|---|
Optional<org.mule.runtime.extension.api.runtime.ConfigurationInstance> |
getConfiguration(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.ComponentModel componentModel,
Event muleEvent)
Returns a
ConfigurationInstance for the given extensionModel and componentModel. |
org.mule.runtime.extension.api.runtime.ConfigurationInstance |
getConfiguration(String configurationProviderName,
Event event)
Returns a
ConfigurationInstance obtained through a previously registered ConfigurationProvider named as
configurationProvider |
Optional<org.mule.runtime.extension.api.runtime.ConfigurationProvider> |
getConfigurationProvider(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.ComponentModel componentModel)
Locates and returns (if there is any) a suitable
ConfigurationProvider for the given ComponentModel. |
Optional<org.mule.runtime.extension.api.runtime.ConfigurationProvider> |
getConfigurationProvider(String configurationProviderName)
Locates and returns the
ConfigurationProvider which would serve an invocation to the
getConfiguration(String, Event) method. |
Optional<org.mule.runtime.api.meta.model.ExtensionModel> |
getExtension(String extensionName)
|
Set<org.mule.runtime.api.meta.model.ExtensionModel> |
getExtensions()
Returns an immutable
Set listing all the discovered
extensionModels. |
void |
registerConfigurationProvider(org.mule.runtime.extension.api.runtime.ConfigurationProvider configurationProvider)
Registered the given
ConfigurationProvider which should be later be used to serve invocations to
getConfigurationProvider(ExtensionModel, ComponentModel) and getConfiguration(String, Event) |
void |
registerExtension(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
Registers the given
ExtensionModel. |
void registerExtension(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
ExtensionModel.extensionModel - the ExtensionModel to be registered. Cannot be nullSet<org.mule.runtime.api.meta.model.ExtensionModel> getExtensions()
Set listing all the discovered
extensionModels.Set. Will not be null but might be emptyOptional<org.mule.runtime.api.meta.model.ExtensionModel> getExtension(String extensionName)
extensionName - the name of the extensions you want.Optional. It will be empty if no such extension is registeredorg.mule.runtime.extension.api.runtime.ConfigurationInstance getConfiguration(String configurationProviderName, Event event)
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 ConfigurationInstance
configurationProviderName - the name of a previously registered ConfigurationProviderevent - the current EventConfigurationInstanceOptional<org.mule.runtime.extension.api.runtime.ConfigurationInstance> getConfiguration(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.ComponentModel componentModel, Event muleEvent)
ConfigurationInstance for the given extensionModel and componentModel.
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
componentModel, 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 and it is unique, then a
ConfigurationProvider is created and registered for that model.IllegalStateException is thrown
By the mere fact of this configuration being returned, the value of ConfigurationStats.getLastUsedMillis() will be
updated for the returned ConfigurationInstance
extensionModel - the ExtensionModel for which a configuration is wantedcomponentModel - the ComponentModel associated to a ConfigurationInstancemuleEvent - the current EventOptional for a ConfigurationInstanceIllegalStateException - if none or too many ConfigurationProvider are found to be suitableOptional<org.mule.runtime.extension.api.runtime.ConfigurationProvider> getConfigurationProvider(String configurationProviderName)
ConfigurationProvider which would serve an invocation to the
getConfiguration(String, Event) method.
This means that the returned provided will be located using the same set of rules as the aforementioned method.
configurationProviderName - the name of a previously registered ConfigurationProviderOptional ConfigurationProviderOptional<org.mule.runtime.extension.api.runtime.ConfigurationProvider> getConfigurationProvider(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.ComponentModel componentModel)
ConfigurationProvider for the given ComponentModel.extensionModel - the ExtensionModel for which a configuration is wantedcomponentModel - the ComponentModel for which a configuration is wantedOptional ConfigurationProvidervoid registerConfigurationProvider(org.mule.runtime.extension.api.runtime.ConfigurationProvider configurationProvider)
ConfigurationProvider which should be later be used to serve invocations to
getConfigurationProvider(ExtensionModel, ComponentModel) and getConfiguration(String, Event)configurationProvider - a ConfigurationProviderCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.