use of org.mule.runtime.core.api.util.func.CheckedConsumer in project mule by mulesoft.
the class ConfigurationProviderObjectFactory method createInnerInstance.
private ConfigurationProvider createInnerInstance() throws ConfigurationException {
if (expirationPolicy == null) {
expirationPolicy = muleContext.getConfiguration().getDynamicConfigExpiration().getExpirationPolicy();
}
ResolverSet resolverSet = getParametersResolver().getParametersAsHashedResolverSet(configurationModel, muleContext);
final ConnectionProviderValueResolver connectionProviderResolver = getConnectionProviderResolver();
return withContextClassLoader(getExtensionClassLoader(), () -> {
connectionProviderResolver.getResolverSet().ifPresent((CheckedConsumer) resolver -> initialiseIfNeeded(resolver, true, muleContext));
ConfigurationProvider configurationProvider;
try {
if (resolverSet.isDynamic() || connectionProviderResolver.isDynamic()) {
configurationProvider = configurationProviderFactory.createDynamicConfigurationProvider(name, extensionModel, configurationModel, resolverSet, connectionProviderResolver, expirationPolicy, reflectionCache, muleContext);
} else {
configurationProvider = configurationProviderFactory.createStaticConfigurationProvider(name, extensionModel, configurationModel, resolverSet, connectionProviderResolver, reflectionCache, muleContext);
}
} catch (Exception e) {
throw new MuleRuntimeException(createStaticMessage(format("Could not create an implicit configuration '%s' for the extension '%s'", configurationModel.getName(), extensionModel.getName())), e);
}
return configurationProvider;
});
}
Aggregations