public abstract class ExtensionComponent<T extends org.mule.runtime.api.meta.model.ComponentModel> extends org.mule.runtime.api.component.AbstractComponent implements MuleContextAware, ErrorMappingsAware, 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.ast.api.ComponentAst> |
cacheIdGenerator |
protected ClassLoader |
classLoader |
protected org.mule.runtime.api.component.location.ConfigurationComponentLocator |
componentLocator |
protected T |
componentModel |
protected ConnectionManagerAdapter |
connectionManager |
protected CursorProviderFactory |
cursorProviderFactory |
protected org.mule.runtime.api.exception.ErrorTypeRepository |
errorTypeRepository |
protected ExpressionManager |
expressionManager |
protected ExtensionManager |
extensionManager |
protected MuleMetadataService |
metadataService |
protected MuleContext |
muleContext |
protected ReflectionCache |
reflectionCache |
protected StreamingManager |
streamingManager |
protected TransactionFactoryLocator |
transactionFactoryLocator |
ANNOTATION_NAME, LOCATION_KEY, ROOT_CONTAINER_NAME_KEY| 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 org.mule.runtime.extension.api.runtime.config.ConfigurationProvider |
getConfigurationProvider() |
protected CursorProviderFactory |
getCursorProviderFactory() |
List<ErrorMapping> |
getErrorMappings() |
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 boolean |
requiresConfig() |
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 |
setAnnotations(Map<QName,Object> newAnnotations) |
void |
setCacheIdGeneratorFactory(MetadataCacheIdGeneratorFactory<org.mule.runtime.ast.api.ComponentAst> cacheIdGeneratorFactory) |
void |
setComponentLocator(org.mule.runtime.api.component.location.ConfigurationComponentLocator componentLocator) |
void |
setMuleContext(MuleContext context) |
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 boolean |
usesDynamicConfiguration() |
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 |
getAnnotation, getAnnotations, getDslSource, getIdentifier, getLocation, getRepresentation, getRootContainerLocation, initRootContainerNameprotected 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
@Inject protected StreamingManager streamingManager
@Inject protected TransactionFactoryLocator transactionFactoryLocator
@Inject protected MuleMetadataService metadataService
protected org.mule.runtime.api.component.location.ConfigurationComponentLocator componentLocator
@Inject protected ReflectionCache reflectionCache
@Inject protected org.mule.runtime.api.exception.ErrorTypeRepository errorTypeRepository
protected MetadataCacheIdGenerator<org.mule.runtime.ast.api.ComponentAst> 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 boolean requiresConfig()
protected org.mule.runtime.extension.api.runtime.config.ConfigurationProvider getConfigurationProvider()
protected boolean usesDynamicConfiguration()
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.ast.api.ComponentAst> cacheIdGeneratorFactory)
@Inject public void setComponentLocator(org.mule.runtime.api.component.location.ConfigurationComponentLocator componentLocator)
public List<ErrorMapping> getErrorMappings()
getErrorMappings in interface ErrorMappingsAwareCopyright © 2003–2020 MuleSoft, Inc.. All rights reserved.