Class DefaultExtensionLoadingContext
java.lang.Object
org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext
- All Implemented Interfaces:
ExtensionLoadingContext
Default implementation of
ExtensionLoadingContext. The fact that this class's attributes are immutable, doesn't mean
that their inner state is in fact immutable also.- Since:
- 1.0
-
Field Summary
Fields inherited from interface org.mule.runtime.extension.api.loader.ExtensionLoadingContext
EXTENSION_LOADER_PROPERTY_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultExtensionLoadingContext(ClassLoader extensionClassLoader, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingContext) DefaultExtensionLoadingContext(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer declarer, ClassLoader extensionClassLoader, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingContext) DefaultExtensionLoadingContext(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer extensionDeclarer, ExtensionModelLoadingRequest request) -
Method Summary
Modifier and TypeMethodDescriptionRegisters a customDeclarationEnricherwhich is executed before the ones that the runtime automatically applies.Registers customDeclarationEnricherwhich are executed before the ones that the runtime automatically applies.addCustomValidator(ExtensionModelValidator extensionModelValidator) Registers a customExtensionModelValidatorto be executed on top of the ones which the runtime applies by default.addCustomValidators(Collection<ExtensionModelValidator> extensionModelValidators) Registers customExtensionModelValidatorto be executed on top of the ones which the runtime applies by default.voidaddParameter(String key, Object value) Adds a custom parameter registered underkeyvoidaddParameters(Map<String, Object> parameters) Adds the contents of the given map as custom parametersOptional<org.mule.runtime.api.artifact.ArtifactCoordinates>org.mule.runtime.api.dsl.DslResolvingContextorg.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarerTheExtensionDeclarerin which the extension is being described into<T> Optional<T>getParameter(String key) Obtains the custom parameter registered underkey.org.mule.metadata.api.ClassTypeLoaderbooleanbooleanboolean
-
Constructor Details
-
DefaultExtensionLoadingContext
public DefaultExtensionLoadingContext(ClassLoader extensionClassLoader, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingContext) -
DefaultExtensionLoadingContext
public DefaultExtensionLoadingContext(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer declarer, ClassLoader extensionClassLoader, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingContext) -
DefaultExtensionLoadingContext
-
DefaultExtensionLoadingContext
public DefaultExtensionLoadingContext(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer extensionDeclarer, ExtensionModelLoadingRequest request)
-
-
Method Details
-
getExtensionDeclarer
public org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer getExtensionDeclarer()TheExtensionDeclarerin which the extension is being described into- Specified by:
getExtensionDeclarerin interfaceExtensionLoadingContext- Returns:
- a non
nullExtensionDeclarer
-
getTypeLoader
public org.mule.metadata.api.ClassTypeLoader getTypeLoader()- Specified by:
getTypeLoaderin interfaceExtensionLoadingContext- Returns:
- a type loader for the types from Java classes within an extension.
-
addParameter
Adds a custom parameter registered underkey- Specified by:
addParameterin interfaceExtensionLoadingContext- Parameters:
key- the key under which thevalueis to be registeredvalue- the custom parameter value
-
addParameters
Description copied from interface:ExtensionLoadingContextAdds the contents of the given map as custom parameters- Specified by:
addParametersin interfaceExtensionLoadingContext- Parameters:
parameters- a map with custom parameters
-
getParameter
Obtains the custom parameter registered underkey.- Specified by:
getParameterin interfaceExtensionLoadingContext- Type Parameters:
T- generic type of the expected value- Parameters:
key- the key under which the wanted value is registered- Returns:
- an
Optionalvalue
-
addCustomValidator
Registers a customExtensionModelValidatorto 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.
- Specified by:
addCustomValidatorin interfaceExtensionLoadingContext- Parameters:
extensionModelValidator- the custom validator- Returns:
thisinstance
-
addCustomValidators
public ExtensionLoadingContext addCustomValidators(Collection<ExtensionModelValidator> extensionModelValidators) Registers customExtensionModelValidatorto 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.
- Specified by:
addCustomValidatorsin interfaceExtensionLoadingContext- Parameters:
extensionModelValidators- the custom validators- Returns:
thisinstance
-
addCustomDeclarationEnricher
Registers a customDeclarationEnricherwhich is executed before the ones that the runtime automatically applies.- Specified by:
addCustomDeclarationEnricherin interfaceExtensionLoadingContext- Parameters:
enricher- the custom enricher- Returns:
thisinstance
-
addCustomDeclarationEnrichers
public ExtensionLoadingContext addCustomDeclarationEnrichers(Collection<DeclarationEnricher> enrichers) Registers customDeclarationEnricherwhich are executed before the ones that the runtime automatically applies.- Specified by:
addCustomDeclarationEnrichersin interfaceExtensionLoadingContext- Parameters:
enrichers- the custom enrichers- Returns:
thisinstance
-
getExtensionClassLoader
- Specified by:
getExtensionClassLoaderin interfaceExtensionLoadingContext- Returns:
- the extension's
ClassLoader
-
getDslResolvingContext
public org.mule.runtime.api.dsl.DslResolvingContext getDslResolvingContext()- Specified by:
getDslResolvingContextin interfaceExtensionLoadingContext- Returns:
- the
DslResolvingContextwith all the dependencies to load anExtensionModel
-
isOCSEnabled
public boolean isOCSEnabled()- Specified by:
isOCSEnabledin interfaceExtensionLoadingContext- Returns:
- whether OCS is enabled
-
isForceExtensionValidation
public boolean isForceExtensionValidation()- Specified by:
isForceExtensionValidationin interfaceExtensionLoadingContext- Returns:
- whether the extension must be validated after being loaded.
-
isResolveMinMuleVersion
public boolean isResolveMinMuleVersion()- Specified by:
isResolveMinMuleVersionin interfaceExtensionLoadingContext- Returns:
- whether the
minMuleVersionof each component must be calculated.
-
getArtifactCoordinates
- Specified by:
getArtifactCoordinatesin interfaceExtensionLoadingContext- Returns:
- the
ArtifactCoordinatesof the Extension
-
getCustomDeclarationEnrichers
- Specified by:
getCustomDeclarationEnrichersin interfaceExtensionLoadingContext- Returns:
- an immutable list with the registered custom enrichers
-
getCustomValidators
- Specified by:
getCustomValidatorsin interfaceExtensionLoadingContext- Returns:
- an immutable list with the registered custom validators
-