use of org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource in project mule by mulesoft.
the class ExtensionSourceObjectFactory method doGetObject.
@Override
public ExtensionMessageSource doGetObject() throws ConfigurationException, InitialisationException {
return withContextClassLoader(getClassLoader(extensionModel), () -> {
getParametersResolver().checkParameterGroupExclusiveness(Optional.of(sourceModel), sourceModel.getParameterGroupModels(), parameters.keySet());
ResolverSet nonCallbackParameters = getNonCallbackParameters();
if (nonCallbackParameters.isDynamic()) {
throw dynamicParameterException(nonCallbackParameters, sourceModel);
}
ResolverSet responseCallbackParameters = getCallbackParameters(sourceModel.getSuccessCallback());
ResolverSet errorCallbackParameters = getCallbackParameters(sourceModel.getErrorCallback());
initialiseIfNeeded(nonCallbackParameters, true, muleContext);
initialiseIfNeeded(responseCallbackParameters, true, muleContext);
initialiseIfNeeded(errorCallbackParameters, true, muleContext);
final BackPressureStrategy backPressureStrategy = getBackPressureStrategy();
return new ExtensionMessageSource(extensionModel, sourceModel, getSourceAdapterFactory(nonCallbackParameters, responseCallbackParameters, errorCallbackParameters, backPressureStrategy), configurationProvider, primaryNodeOnly != null ? primaryNodeOnly : sourceModel.runsOnPrimaryNodeOnly(), getRetryPolicyTemplate(), cursorProviderFactory, backPressureStrategy, muleContext.getExtensionManager());
});
}
Aggregations