Search in sources :

Example 1 with PrivilegedExport

use of org.mule.runtime.extension.api.annotation.PrivilegedExport in project mule by mulesoft.

the class JavaPrivilegedExportedTypesDeclarationEnricher method enrich.

@Override
public void enrich(ExtensionLoadingContext extensionLoadingContext) {
    ExtensionDeclarer extensionDeclarer = extensionLoadingContext.getExtensionDeclarer();
    extensionDeclarer.getDeclaration().getModelProperty(ExtensionTypeDescriptorModelProperty.class).map(ExtensionTypeDescriptorModelProperty::getType).flatMap(type -> type.getValueFromAnnotation(PrivilegedExport.class)).ifPresent(valueFetcher -> {
        valueFetcher.getArrayValue(PrivilegedExport::artifacts).forEach(extensionDeclarer::withPrivilegedArtifact);
        valueFetcher.getArrayValue(PrivilegedExport::packages).forEach(extensionDeclarer::withPrivilegedPackage);
    });
}
Also used : ExtensionTypeDescriptorModelProperty(org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionTypeDescriptorModelProperty) ExtensionLoadingContext(org.mule.runtime.extension.api.loader.ExtensionLoadingContext) ExtensionDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer) PrivilegedExport(org.mule.runtime.extension.api.annotation.PrivilegedExport) ExtensionTypeDescriptorModelProperty(org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionTypeDescriptorModelProperty) ExtensionDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)

Aggregations

ExtensionDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)1 PrivilegedExport (org.mule.runtime.extension.api.annotation.PrivilegedExport)1 ExtensionLoadingContext (org.mule.runtime.extension.api.loader.ExtensionLoadingContext)1 ExtensionTypeDescriptorModelProperty (org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionTypeDescriptorModelProperty)1