public abstract class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel> extends org.mule.runtime.api.component.AbstractComponent implements MuleContextAware, org.mule.runtime.api.metadata.MetadataKeyProvider, org.mule.runtime.api.metadata.MetadataProvider<T>, org.mule.runtime.extension.api.values.ComponentValueProvider, org.mule.runtime.api.lifecycle.Lifecycle
OperationMessageProcessor and
ExtensionMessageSource.
Provides capabilities of Metadata resolution and configuration validation.
| Modifier and Type | Field and Description |
|---|---|
protected MetadataCacheIdGenerator<org.mule.runtime.dsl.api.component.config.ComponentConfiguration> |
cacheIdGenerator |
protected ClassLoader |
classLoader |
protected T |
componentModel |
protected ConnectionManagerAdapter |
connectionManager |
protected CursorProviderFactory |
cursorProviderFactory |
protected ExpressionManager |
expressionManager |
protected ExtensionManager |
extensionManager |
protected MuleMetadataService |
metadataService |
protected MuleContext |
muleContext |
protected ReflectionCache |
reflectionCache |
protected StreamingManager |
streamingManager |
protected TransactionFactoryLocator |
transactionFactoryLocator |
| Modifier | Constructor and Description |
|---|---|
protected |
ExtensionComponent(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
T componentModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
CursorProviderFactory cursorProviderFactory,
ExtensionManager extensionManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Delegates into
doDispose() making sure that it executes using the extension's class loader |
protected abstract void |
doDispose()
Implementors will use this method to perform their own disposing logic
|
protected abstract void |
doInitialise()
Implementors will use this method to perform their own initialisation logic
|
protected abstract void |
doStart()
Implementors will use this method to perform their own starting logic
|
protected abstract void |
doStop()
Implementors will use this method to perform their own stopping logic
|
protected Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> |
getConfiguration(CoreEvent event) |
protected CursorProviderFactory |
getCursorProviderFactory() |
org.mule.runtime.api.meta.model.ExtensionModel |
getExtensionModel() |
org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> |
getMetadata() |
org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> |
getMetadata(org.mule.runtime.api.metadata.MetadataKey key) |
org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.MetadataKeysContainer> |
getMetadataKeys() |
List<org.mule.runtime.api.meta.model.parameter.ValueProviderModel> |
getModels(String providerName) |
protected abstract ParameterValueResolver |
getParameterValueResolver() |
protected Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> |
getStaticConfiguration()
Similar to
getConfiguration(CoreEvent) but only works if the configurationProvider is static. |
Set<org.mule.runtime.api.value.Value> |
getValues(String parameterName) |
void |
initialise()
Makes sure that the operation is valid by invoking
validateOperationConfiguration(ConfigurationProvider) and then
delegates on doInitialise() for custom initialisation |
protected <R> org.mule.runtime.api.metadata.resolving.MetadataResult<R> |
runWithMetadataContext(Function<org.mule.runtime.api.metadata.MetadataContext,org.mule.runtime.api.metadata.resolving.MetadataResult<R>> contextConsumer) |
void |
setCacheIdGeneratorFactory(MetadataCacheIdGeneratorFactory<org.mule.runtime.dsl.api.component.config.ComponentConfiguration> cacheIdGeneratorFactory) |
void |
setMuleContext(MuleContext context) |
void |
setStreamingManager(StreamingManager streamingManager) |
void |
start()
Delegates into
doStart() making sure that it executes using the extension's class loader |
void |
stop()
Delegates into
doStop() making sure that it executes using the extension's class loader |
protected abstract void |
validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
Validates that the configuration returned by the
configurationProvider is compatible with the associated
ComponentModel |
protected final ExtensionManager extensionManager
protected final ClassLoader classLoader
protected final T extends org.mule.runtime.api.meta.model.ComponentModel componentModel
protected CursorProviderFactory cursorProviderFactory
protected MuleContext muleContext
@Inject protected ExpressionManager expressionManager
@Inject protected ConnectionManagerAdapter connectionManager
protected StreamingManager streamingManager
@Inject protected TransactionFactoryLocator transactionFactoryLocator
@Inject protected MuleMetadataService metadataService
@Inject protected ReflectionCache reflectionCache
protected MetadataCacheIdGenerator<org.mule.runtime.dsl.api.component.config.ComponentConfiguration> cacheIdGenerator
protected ExtensionComponent(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
T componentModel,
org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider,
CursorProviderFactory cursorProviderFactory,
ExtensionManager extensionManager)
public final void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
validateOperationConfiguration(ConfigurationProvider) and then
delegates on doInitialise() for custom initialisationinitialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationException - if a fatal error occurs causing the Mule instance to shutdownpublic final void start()
throws org.mule.runtime.api.exception.MuleException
doStart() making sure that it executes using the extension's class loaderstart in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleException - if the phase couldn't be appliedpublic final void stop()
throws org.mule.runtime.api.exception.MuleException
doStop() making sure that it executes using the extension's class loaderstop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleException - if the phase couldn't be appliedpublic final void dispose()
doDispose() making sure that it executes using the extension's class loaderdispose in interface org.mule.runtime.api.lifecycle.Disposableprotected abstract void doInitialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationException - if a fatal error occurs causing the Mule instance to shutdownprotected abstract void doStart()
throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleException - if the component could not startprotected abstract void doStop()
throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleException - if the component could not stopprotected abstract void doDispose()
protected abstract void validateOperationConfiguration(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider configurationProvider)
configurationProvider is compatible with the associated
ComponentModelconfigurationProvider - public void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwarepublic org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.MetadataKeysContainer> getMetadataKeys()
throws org.mule.runtime.api.metadata.MetadataResolvingException
getMetadataKeys in interface org.mule.runtime.api.metadata.MetadataKeyProviderorg.mule.runtime.api.metadata.MetadataResolvingExceptionpublic org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> getMetadata() throws org.mule.runtime.api.metadata.MetadataResolvingException
getMetadata in interface org.mule.runtime.api.metadata.MetadataProvider<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.metadata.MetadataResolvingExceptionpublic org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> getMetadata(org.mule.runtime.api.metadata.MetadataKey key) throws org.mule.runtime.api.metadata.MetadataResolvingException
getMetadata in interface org.mule.runtime.api.metadata.MetadataProvider<T extends org.mule.runtime.api.meta.model.ComponentModel>org.mule.runtime.api.metadata.MetadataResolvingExceptionpublic Set<org.mule.runtime.api.value.Value> getValues(String parameterName) throws org.mule.runtime.extension.api.values.ValueResolvingException
getValues in interface org.mule.runtime.extension.api.values.ComponentValueProviderorg.mule.runtime.extension.api.values.ValueResolvingExceptionprotected <R> org.mule.runtime.api.metadata.resolving.MetadataResult<R> runWithMetadataContext(Function<org.mule.runtime.api.metadata.MetadataContext,org.mule.runtime.api.metadata.resolving.MetadataResult<R>> contextConsumer) throws org.mule.runtime.api.metadata.MetadataResolvingException, org.mule.runtime.api.connection.ConnectionException
org.mule.runtime.api.metadata.MetadataResolvingExceptionorg.mule.runtime.api.connection.ConnectionExceptionprotected Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> getConfiguration(CoreEvent event)
protected Optional<org.mule.runtime.extension.api.runtime.config.ConfigurationInstance> getStaticConfiguration()
getConfiguration(CoreEvent) but only works if the configurationProvider is static. Otherwise,
returns an empty value.protected CursorProviderFactory getCursorProviderFactory()
protected abstract ParameterValueResolver getParameterValueResolver()
public org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()
public List<org.mule.runtime.api.meta.model.parameter.ValueProviderModel> getModels(String providerName)
getModels in interface org.mule.runtime.extension.api.values.ComponentValueProvider@Inject public void setCacheIdGeneratorFactory(MetadataCacheIdGeneratorFactory<org.mule.runtime.dsl.api.component.config.ComponentConfiguration> cacheIdGeneratorFactory)
@Inject public void setStreamingManager(StreamingManager streamingManager)
Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.