private void declareSubflow(ExtensionDeclarer extensionDeclarer) { ConstructDeclarer flow = extensionDeclarer.withConstruct("subFlow") .allowingTopLevelDefinition(); flow.withChain().setRequired(true).withAllowedStereotypes(PROCESSOR); }
private void declareConfigurationProperties(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) { ConstructDeclarer configuration = extensionDeclarer.withConstruct("configurationProperties") .allowingTopLevelDefinition() .withStereotype(APP_CONFIG) .describedAs("References a file with configuration properties. Each property has a key and a value. \n" + "The key can be referenced from the mule configuration files using the following semantics: \n" + "${key_name}. This allows to externalize configuration and change it based\n" + "on the environment the application is being deployed to."); configuration.onDefaultParameterGroup() .withRequiredParameter("file") .ofType(typeLoader.load(String.class)) .withExpressionSupport(NOT_SUPPORTED) .withDisplayModel(DisplayModel.builder().path(new PathModel(FILE, false, EMBEDDED, new String[] {"properties"})).build()) .describedAs(" The location of the file with the configuration properties to use. " + "It may be a location in the classpath or an absolute location. The file location\n" + " value may also contains references to properties that will only be resolved based on " + "system properties or properties set at deployment time."); }
private void declareFlow(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) { ConstructDeclarer flow = extensionDeclarer.withConstruct(FLOW_ELEMENT_IDENTIFIER) .allowingTopLevelDefinition() .withStereotype(FLOW); flow.onDefaultParameterGroup().withOptionalParameter("initialState").defaultingTo("started") .ofType(BaseTypeBuilder.create(JAVA).stringType().enumOf("started", "stopped").build()); flow.onDefaultParameterGroup().withOptionalParameter("maxConcurrency") .ofType(typeLoader.load(Integer.class)); flow.withComponent("source") .withAllowedStereotypes(MuleStereotypes.SOURCE); flow.withChain().setRequired(true); flow.withComponent("errorHandler") .withAllowedStereotypes(ERROR_HANDLER); }
private void declareErrorHandler(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) { ConstructDeclarer errorHandler = extensionDeclarer.withConstruct("errorHandler") .withStereotype(ERROR_HANDLER) .allowingTopLevelDefinition() .describedAs("Allows the definition of internal selective handlers. It will route the error to the first handler that matches it." + " If there's no match, then a default error handler will be executed.");
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.");