configurationDeclarer.withConnectionProvider(MODULE_CONNECTION_GLOBAL_ELEMENT_NAME); connectionProviderDeclarer .withConnectionManagementType(ConnectionManagementType.NONE);
private ExtensionModel mockedExtension(final String name, final String config, final String connectionProvider, boolean supportsConnectivityTesting) { final ExtensionDeclarer extensionDeclarer = new ExtensionDeclarer(); extensionDeclarer.named(name) .onVersion("4.0.0") .fromVendor("MuleSoft testcase") .withCategory(Category.COMMUNITY) .withConfig(config) .withConnectionProvider(connectionProvider) .supportsConnectivityTesting(supportsConnectivityTesting) .withConnectionManagementType(ConnectionManagementType.NONE); return new ExtensionModelFactory() .create(new DefaultExtensionLoadingContext(extensionDeclarer, currentThread().getContextClassLoader(), new NullDslResolvingContext())); }
/** * Declares a new connection provider for a configuration given a {@link SoapServiceProviderWrapper} declaration. * * @param configDeclarer the configuration declarer that will own the provider * @param provider a {@link SoapServiceProviderWrapper} that describes the {@link SoapServiceProvider} Type. * @param hasCustomTransports if declares custom transport or not. */ public void declare(ConfigurationDeclarer configDeclarer, SoapServiceProviderWrapper provider, boolean hasCustomTransports) { String description = provider.getDescription(); // Declares the Service Provider as a Connection Provider. ConnectionProviderDeclarer providerDeclarer = configDeclarer.withConnectionProvider(provider.getAlias()) .describedAs(description) .withModelProperty(new ConnectionTypeModelProperty(ForwardingSoapClient.class)) //TODO - MULE-14311 - Make loader work in compile time .withModelProperty(new ImplementingTypeModelProperty(provider.getDeclaringClass().get())) .withConnectionManagementType(POOLING) .supportsConnectivityTesting(provider.supportsConnectivityTesting()); ParameterDeclarationContext context = new ParameterDeclarationContext("Service Provider", providerDeclarer.getDeclaration()); parametersLoader.declare(providerDeclarer, provider.getParameters(), context); if (hasCustomTransports) { providerDeclarer.onParameterGroup(TRANSPORT_GROUP) .withRequiredParameter(TRANSPORT_PARAM) .withDisplayModel(DisplayModel.builder().displayName(TRANSPORT_GROUP).build()) .ofType(typeLoader.load(MessageDispatcherProvider.class)) .withLayout(LayoutModel.builder().order(1).tabName(TRANSPORT).build()) .withExpressionSupport(NOT_SUPPORTED); } }