use of org.mule.runtime.module.deployment.impl.internal.policy.DefaultPolicyInstanceProviderFactory in project mule by mulesoft.
the class DefaultApplicationFactory method createArtifact.
public Application createArtifact(ApplicationDescriptor descriptor) throws IOException {
Domain domain = getApplicationDomain(descriptor);
List<ArtifactPluginDescriptor> resolvedArtifactPluginDescriptors = pluginDependenciesResolver.resolve(domain.getDescriptor().getPlugins(), new ArrayList<>(getArtifactPluginDescriptors(descriptor)));
// Refreshes the list of plugins on the descriptor with the resolved from domain and transitive plugin dependencies
Set resolvedArtifactPlugins = new LinkedHashSet<>();
resolvedArtifactPlugins.addAll(resolvedArtifactPluginDescriptors);
descriptor.setPlugins(resolvedArtifactPlugins);
ApplicationClassLoaderBuilder artifactClassLoaderBuilder = applicationClassLoaderBuilderFactory.createArtifactClassLoaderBuilder();
MuleDeployableArtifactClassLoader applicationClassLoader = artifactClassLoaderBuilder.setDomain(domain).addArtifactPluginDescriptors(resolvedArtifactPluginDescriptors.toArray(new ArtifactPluginDescriptor[0])).setArtifactId(descriptor.getName()).setArtifactDescriptor(descriptor).build();
List<ArtifactPlugin> artifactPlugins = createArtifactPluginList(applicationClassLoader, resolvedArtifactPluginDescriptors);
MuleApplicationPolicyProvider applicationPolicyProvider = new MuleApplicationPolicyProvider(new DefaultPolicyTemplateFactory(policyTemplateClassLoaderBuilderFactory, pluginDependenciesResolver, licenseValidator), new DefaultPolicyInstanceProviderFactory(serviceRepository, classLoaderRepository, extensionModelLoaderRepository));
DefaultMuleApplication delegate = new DefaultMuleApplication(descriptor, applicationClassLoader, artifactPlugins, domainRepository, serviceRepository, extensionModelLoaderRepository, descriptor.getArtifactLocation(), classLoaderRepository, applicationPolicyProvider);
applicationPolicyProvider.setApplication(delegate);
return new ApplicationWrapper(delegate);
}
Aggregations