Interface ExtensionLoadingContext

All Known Implementing Classes:
DefaultExtensionLoadingContext

@NoImplement public interface ExtensionLoadingContext
Used for propagating state across all the components that take part into loading an ExtensionModel.

Each instance should be used to load one and only one ExtensionModel. Use different instances if you're going to load several models.

Since:
1.0
  • Field Details

  • Method Details

    • getExtensionDeclarer

      org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer getExtensionDeclarer()
      The ExtensionDeclarer in which the extension is being described into
      Returns:
      a non null ExtensionDeclarer
    • getTypeLoader

      org.mule.metadata.api.ClassTypeLoader getTypeLoader()
      Returns:
      a type loader for the types from Java classes within an extension.
      Since:
      1.9
    • addParameter

      void addParameter(String key, Object value)
      Adds a custom parameter registered under key
      Parameters:
      key - the key under which the value is to be registered
      value - the custom parameter value
      Throws:
      IllegalArgumentException - if key or value are null
    • addParameters

      void addParameters(Map<String,Object> parameters)
      Adds the contents of the given map as custom parameters
      Parameters:
      parameters - a map with custom parameters
    • getParameter

      <T> Optional<T> getParameter(String key)
      Obtains the custom parameter registered under key.
      Type Parameters:
      T - generic type of the expected value
      Parameters:
      key - the key under which the wanted value is registered
      Returns:
      an Optional value
    • addCustomValidator

      ExtensionLoadingContext addCustomValidator(ExtensionModelValidator extensionModelValidator)
      Registers a custom ExtensionModelValidator to be executed on top of the ones which the runtime applies by default.

      Custom validators will not apply globally but just for the model being loaded with this context.

      Parameters:
      extensionModelValidator - the custom validator
      Returns:
      this instance
    • addCustomValidators

      ExtensionLoadingContext addCustomValidators(Collection<ExtensionModelValidator> extensionModelValidators)
      Registers custom ExtensionModelValidator to be executed on top of the ones which the runtime applies by default.

      These custom validators will not apply globaly but just for the model being loaded with this context.

      Parameters:
      extensionModelValidators - the custom validators
      Returns:
      this instance
    • addCustomDeclarationEnricher

      ExtensionLoadingContext addCustomDeclarationEnricher(DeclarationEnricher enricher)
      Registers a custom DeclarationEnricher which is executed before the ones that the runtime automatically applies.
      Parameters:
      enricher - the custom enricher
      Returns:
      this instance
    • addCustomDeclarationEnrichers

      ExtensionLoadingContext addCustomDeclarationEnrichers(Collection<DeclarationEnricher> enrichers)
      Registers custom DeclarationEnricher which are executed before the ones that the runtime automatically applies.
      Parameters:
      enrichers - the custom enrichers
      Returns:
      this instance
    • getCustomDeclarationEnrichers

      List<DeclarationEnricher> getCustomDeclarationEnrichers()
      Returns:
      an immutable list with the registered custom enrichers
    • getCustomValidators

      List<ExtensionModelValidator> getCustomValidators()
      Returns:
      an immutable list with the registered custom validators
    • getExtensionClassLoader

      ClassLoader getExtensionClassLoader()
      Returns:
      the extension's ClassLoader
    • getDslResolvingContext

      org.mule.runtime.api.dsl.DslResolvingContext getDslResolvingContext()
      Returns:
      the DslResolvingContext with all the dependencies to load an ExtensionModel
    • isOCSEnabled

      boolean isOCSEnabled()
      Returns:
      whether OCS is enabled
      Since:
      1.5
    • isForceExtensionValidation

      boolean isForceExtensionValidation()
      Returns:
      whether the extension must be validated after being loaded.
      Since:
      1.7
    • isResolveMinMuleVersion

      boolean isResolveMinMuleVersion()
      Returns:
      whether the minMuleVersion of each component must be calculated.
      Since:
      1.9
    • getArtifactCoordinates

      default Optional<org.mule.runtime.api.artifact.ArtifactCoordinates> getArtifactCoordinates()
      Returns:
      the ArtifactCoordinates of the Extension
      Since:
      1.5