Search in sources :

Example 1 with DynamicConfigExpirationTypeBuilder

use of org.mule.runtime.extension.api.declaration.type.DynamicConfigExpirationTypeBuilder in project mule by mulesoft.

the class MuleExtensionModelDeclarer method declareConfiguration.

private void declareConfiguration(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) {
    ConstructDeclarer configuration = extensionDeclarer.withConstruct("configuration").allowingTopLevelDefinition().withStereotype(APP_CONFIG).describedAs("Specifies defaults and general settings for the Mule instance.");
    addReconnectionStrategyParameter(configuration.getDeclaration());
    configuration.onDefaultParameterGroup().withOptionalParameter("defaultResponseTimeout").ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).defaultingTo("10000").describedAs("The default period (ms) to wait for a synchronous response.");
    configuration.onDefaultParameterGroup().withOptionalParameter("defaultTransactionTimeout").ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).defaultingTo("30000").describedAs("The default timeout (ms) for transactions. This can also be configured on transactions, " + "in which case the transaction configuration is used instead of this default.");
    configuration.onDefaultParameterGroup().withOptionalParameter("defaultErrorHandler-ref").ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).describedAs("The default error handler for every flow. This must be a reference to a global error handler.");
    configuration.onDefaultParameterGroup().withOptionalParameter("shutdownTimeout").ofType(typeLoader.load(Integer.class)).withExpressionSupport(NOT_SUPPORTED).defaultingTo("5000").describedAs("The time in milliseconds to wait for any in-progress work to finish running before Mule shuts down. " + "After this threshold has been reached, Mule starts stopping schedulers and interrupting threads, " + "and messages can be lost. If you have a very large number of services in the same Mule instance, " + "if you have components that take more than a couple seconds to process, or if you are using large " + "payloads and/or slower transports, you should increase this value to allow more time for graceful shutdown." + " The value you specify is applied to services and separately to dispatchers, so the default value of " + "5000 milliseconds specifies that Mule has ten seconds to process and dispatch messages gracefully after " + "shutdown is initiated.");
    configuration.onDefaultParameterGroup().withOptionalParameter("maxQueueTransactionFilesSize").ofType(typeLoader.load(Integer.class)).withExpressionSupport(NOT_SUPPORTED).defaultingTo("500").describedAs("Sets the approximate maximum space in megabytes allowed for the transaction log files for transactional persistent queues." + " Take into account that this number applies both to the set of transaction log files for XA and for local transactions. " + "If both types of transactions are used then the approximate maximum space used, will be twice the configured value.");
    configuration.onDefaultParameterGroup().withOptionalParameter("defaultObjectSerializer-ref").ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).describedAs("An optional reference to an ObjectSerializer to be used as the application's default");
    configuration.onDefaultParameterGroup().withOptionalParameter("dynamicConfigExpiration").describedAs(DYNAMIC_CONFIG_EXPIRATION_DESCRIPTION).ofType(new DynamicConfigExpirationTypeBuilder().buildDynamicConfigExpirationType()).withExpressionSupport(NOT_SUPPORTED).withDsl(ParameterDslConfiguration.builder().allowsReferences(false).allowsInlineDefinition(true).allowTopLevelDefinition(false).build());
}
Also used : ConstructDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclarer) DynamicConfigExpirationTypeBuilder(org.mule.runtime.extension.api.declaration.type.DynamicConfigExpirationTypeBuilder)

Aggregations

ConstructDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclarer)1 DynamicConfigExpirationTypeBuilder (org.mule.runtime.extension.api.declaration.type.DynamicConfigExpirationTypeBuilder)1