Search in sources :

Example 1 with ExtensionMessageSource

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());
    });
}
Also used : ResolverSet(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet) MuleExtensionUtils.toBackPressureStrategy(org.mule.runtime.module.extension.internal.util.MuleExtensionUtils.toBackPressureStrategy) BackPressureStrategy(org.mule.runtime.core.api.source.MessageSource.BackPressureStrategy) ExtensionMessageSource(org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource)

Aggregations

BackPressureStrategy (org.mule.runtime.core.api.source.MessageSource.BackPressureStrategy)1 ResolverSet (org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet)1 ExtensionMessageSource (org.mule.runtime.module.extension.internal.runtime.source.ExtensionMessageSource)1 MuleExtensionUtils.toBackPressureStrategy (org.mule.runtime.module.extension.internal.util.MuleExtensionUtils.toBackPressureStrategy)1