This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 55c9815b8de5c1e08c040c34b4b89ddb9e526c89 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 15:03:18 2026 +0100 CAMEL-23832: camel-bean - improve the component and option descriptions Rewrites the component descriptions of the bean and class schemes, the two component options (scope, beanInfoCacheSize) and the four endpoint options (beanName, method, scope, parameters). The component scope text named a "delegate" scope that does not exist, and beanName and method did not say how the bean is found or which method syntax is accepted. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-bean is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/catalog/components/bean.json | 14 ++-- .../org/apache/camel/catalog/components/class.json | 14 ++-- .../apache/camel/catalog/docs/bean-component.adoc | 2 +- .../apache/camel/catalog/docs/class-component.adoc | 2 +- .../org/apache/camel/component/bean/bean.json | 14 ++-- .../apache/camel/component/beanclass/class.json | 14 ++-- .../camel-bean/src/main/docs/bean-component.adoc | 2 +- .../camel-bean/src/main/docs/class-component.adoc | 2 +- .../apache/camel/component/bean/BeanComponent.java | 17 ++--- .../apache/camel/component/bean/BeanEndpoint.java | 36 ++++++---- .../camel/component/beanclass/ClassEndpoint.java | 2 +- .../component/ComponentsBuilderFactory.java | 5 +- .../component/dsl/BeanComponentBuilderFactory.java | 30 ++++---- .../component/dsl/ClasComponentBuilderFactory.java | 28 +++----- .../builder/endpoint/StaticEndpointBuilders.java | 30 +++++--- .../endpoint/dsl/BeanEndpointBuilderFactory.java | 82 ++++++++++++---------- .../endpoint/dsl/ClassEndpointBuilderFactory.java | 81 +++++++++++---------- tasks/component-descriptions.md | 2 +- 18 files changed, 197 insertions(+), 180 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json index 57299036fcf5..053adca91eb5 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json @@ -3,7 +3,7 @@ "kind": "component", "name": "bean", "title": "Bean", - "description": "Invoke methods of Java beans stored in Camel registry.", + "description": "Invoke a method of a Java bean, looked up by name in the Camel registry or created from a class name.", "deprecated": false, "firstVersion": "1.0.0", "label": "core,script", @@ -25,19 +25,19 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be [...] + "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "The scope that the endpoints use when they do not set their own scope option. Singleton looks up or creates the bean once per endpoint, so it must be thread-s [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } + "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum number of entries in the cache of bean introspection results (the methods that Camel finds by reflection on a bean class). The cache of the bean component is also used by the class compon [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } }, "properties": { - "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, - "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean shou [...] + "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean to invoke. The bean component looks it up in the Camel registry and, when no bean has that name, takes it as a class name and creates an instance. The class component takes it as the fully qualified class name." }, + "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the method to invoke on the bean. When not set, Camel chooses the method with the bean binding rules, for example the method annotated with Handler or the method whose parameter matches the message body. Parameters can follow [...] + "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "How long a bean instance is reused. Singleton: the bean is looked up or created once and used for the lifetime of the endpoint, so it must be thread-safe [...] "lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Used for configuring additional properties on the bean. This is a multi-value option with prefix: bean." } + "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Properties to set on the bean, each given with the bean. prefix: bean.timeout=5000 calls setTimeout(5000) on the bean. The properties are set each time t [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json index d049697814ae..2f9a6d0c7614 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json @@ -3,7 +3,7 @@ "kind": "component", "name": "class", "title": "Class", - "description": "Invoke methods of Java beans specified by class name.", + "description": "Invoke a method of a Java bean given by its fully qualified class name.", "deprecated": false, "firstVersion": "2.4.0", "label": "core,script", @@ -25,19 +25,19 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be [...] + "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "The scope that the endpoints use when they do not set their own scope option. Singleton looks up or creates the bean once per endpoint, so it must be thread-s [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } + "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum number of entries in the cache of bean introspection results (the methods that Camel finds by reflection on a bean class). The cache of the bean component is also used by the class compon [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } }, "properties": { - "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, - "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean shou [...] + "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean to invoke. The bean component looks it up in the Camel registry and, when no bean has that name, takes it as a class name and creates an instance. The class component takes it as the fully qualified class name." }, + "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the method to invoke on the bean. When not set, Camel chooses the method with the bean binding rules, for example the method annotated with Handler or the method whose parameter matches the message body. Parameters can follow [...] + "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "How long a bean instance is reused. Singleton: the bean is looked up or created once and used for the lifetime of the endpoint, so it must be thread-safe [...] "lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Used for configuring additional properties on the bean. This is a multi-value option with prefix: bean." } + "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Properties to set on the bean, each given with the bean. prefix: bean.timeout=5000 calls setTimeout(5000) on the bean. The properties are set each time t [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bean-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bean-component.adoc index eacda2667039..cee91536dce5 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bean-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/bean-component.adoc @@ -2,7 +2,7 @@ :doctitle: Bean :shortname: bean :artifactid: camel-bean -:description: Invoke methods of Java beans stored in Camel registry. +:description: Invoke a method of a Java bean, looked up by name in the Camel registry or created from a class name. :since: 1.0 :supportlevel: Stable :tabs-sync-option: diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/class-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/class-component.adoc index f28cdfe6f565..cc58fb6ccd4f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/class-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/class-component.adoc @@ -2,7 +2,7 @@ :doctitle: Class :shortname: class :artifactid: camel-bean -:description: Invoke methods of Java beans specified by class name. +:description: Invoke a method of a Java bean given by its fully qualified class name. :since: 2.4 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json index 57299036fcf5..053adca91eb5 100644 --- a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json +++ b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json @@ -3,7 +3,7 @@ "kind": "component", "name": "bean", "title": "Bean", - "description": "Invoke methods of Java beans stored in Camel registry.", + "description": "Invoke a method of a Java bean, looked up by name in the Camel registry or created from a class name.", "deprecated": false, "firstVersion": "1.0.0", "label": "core,script", @@ -25,19 +25,19 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be [...] + "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "The scope that the endpoints use when they do not set their own scope option. Singleton looks up or creates the bean once per endpoint, so it must be thread-s [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } + "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum number of entries in the cache of bean introspection results (the methods that Camel finds by reflection on a bean class). The cache of the bean component is also used by the class compon [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } }, "properties": { - "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, - "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean shou [...] + "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean to invoke. The bean component looks it up in the Camel registry and, when no bean has that name, takes it as a class name and creates an instance. The class component takes it as the fully qualified class name." }, + "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the method to invoke on the bean. When not set, Camel chooses the method with the bean binding rules, for example the method annotated with Handler or the method whose parameter matches the message body. Parameters can follow [...] + "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "How long a bean instance is reused. Singleton: the bean is looked up or created once and used for the lifetime of the endpoint, so it must be thread-safe [...] "lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Used for configuring additional properties on the bean. This is a multi-value option with prefix: bean." } + "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Properties to set on the bean, each given with the bean. prefix: bean.timeout=5000 calls setTimeout(5000) on the bean. The properties are set each time t [...] } } diff --git a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json index d049697814ae..2f9a6d0c7614 100644 --- a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json +++ b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json @@ -3,7 +3,7 @@ "kind": "component", "name": "class", "title": "Class", - "description": "Invoke methods of Java beans specified by class name.", + "description": "Invoke a method of a Java bean given by its fully qualified class name.", "deprecated": false, "firstVersion": "2.4.0", "label": "core,script", @@ -25,19 +25,19 @@ }, "componentProperties": { "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...] - "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be [...] + "scope": { "index": 1, "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "The scope that the endpoints use when they do not set their own scope option. Singleton looks up or creates the bean once per endpoint, so it must be thread-s [...] "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] - "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } + "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum number of entries in the cache of bean introspection results (the methods that Camel finds by reflection on a bean class). The cache of the bean component is also used by the class compon [...] }, "bodyTypes": { "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } }, "properties": { - "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, - "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean shou [...] + "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the bean to invoke. The bean component looks it up in the Camel registry and, when no bean has that name, takes it as a class name and creates an instance. The class component takes it as the fully qualified class name." }, + "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the method to invoke on the bean. When not set, Camel chooses the method with the bean binding rules, for example the method annotated with Handler or the method whose parameter matches the message body. Parameters can follow [...] + "scope": { "index": 2, "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "org.apache.camel.BeanScope", "enum": [ "Singleton", "Request", "Prototype" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "Singleton", "description": "How long a bean instance is reused. Singleton: the bean is looked up or created once and used for the lifetime of the endpoint, so it must be thread-safe [...] "lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Used for configuring additional properties on the bean. This is a multi-value option with prefix: bean." } + "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "bean.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "Properties to set on the bean, each given with the bean. prefix: bean.timeout=5000 calls setTimeout(5000) on the bean. The properties are set each time t [...] } } diff --git a/components/camel-bean/src/main/docs/bean-component.adoc b/components/camel-bean/src/main/docs/bean-component.adoc index eacda2667039..cee91536dce5 100644 --- a/components/camel-bean/src/main/docs/bean-component.adoc +++ b/components/camel-bean/src/main/docs/bean-component.adoc @@ -2,7 +2,7 @@ :doctitle: Bean :shortname: bean :artifactid: camel-bean -:description: Invoke methods of Java beans stored in Camel registry. +:description: Invoke a method of a Java bean, looked up by name in the Camel registry or created from a class name. :since: 1.0 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-bean/src/main/docs/class-component.adoc b/components/camel-bean/src/main/docs/class-component.adoc index f28cdfe6f565..cc58fb6ccd4f 100644 --- a/components/camel-bean/src/main/docs/class-component.adoc +++ b/components/camel-bean/src/main/docs/class-component.adoc @@ -2,7 +2,7 @@ :doctitle: Class :shortname: class :artifactid: camel-bean -:description: Invoke methods of Java beans specified by class name. +:description: Invoke a method of a Java bean given by its fully qualified class name. :since: 2.4 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanComponent.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanComponent.java index 652663f29f45..4de71034dc5a 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanComponent.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanComponent.java @@ -41,19 +41,16 @@ public class BeanComponent extends DefaultComponent { // for example the bean language using OGNL expression runs much faster reusing the BeanInfo from this cache private Map<BeanInfoCacheKey, BeanInfo> beanInfoCache; - @Metadata(defaultValue = "Singleton", description = "Scope of bean." - + " When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint." - + " The bean should be thread-safe in case concurrent threads is calling the bean at the same time." - + " When using request scope the bean is created or looked up once per request (exchange). This can be used if you want to store state on a bean" - + " while processing a request and you want to call the same bean instance multiple times while processing the request." - + " The bean does not have to be thread-safe as the instance is only called from the same request." - + " When using delegate scope, then the bean will be looked up or created per call. However in case of lookup then this is delegated " - + " to the bean registry such as Spring or CDI (if in use), which depends on their configuration can act as either singleton or prototype scope." - + " so when using prototype then this depends on the delegated registry.") + @Metadata(defaultValue = "Singleton", + description = "The scope that the endpoints use when they do not set their own scope option. Singleton" + + " looks up or creates the bean once per endpoint, so it must be thread-safe. Request uses one" + + " instance per exchange, and Prototype looks up or creates the bean on each call.") private BeanScope scope = BeanScope.Singleton; @Metadata(label = "advanced", defaultValue = "1000", - description = "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache.") + description = "The maximum number of entries in the cache of bean introspection results (the methods that" + + " Camel finds by reflection on a bean class). The cache of the bean component is also used by" + + " the class component and the bean language. A value of 0 or less disables the cache.") private int beanInfoCacheSize = 1000; public BeanComponent() { diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java index be382ee6411c..0061247e1d72 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java @@ -36,7 +36,7 @@ import org.apache.camel.support.DefaultEndpoint; import org.apache.camel.util.ObjectHelper; /** - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry or created from a class name. */ @UriEndpoint(firstVersion = "1.0.0", scheme = "bean", title = "Bean", syntax = "bean:beanName", producerOnly = true, remote = false, category = { Category.CORE, Category.SCRIPT }) @@ -50,23 +50,31 @@ import org.apache.camel.util.ObjectHelper; public class BeanEndpoint extends DefaultEndpoint { private transient BeanHolder beanHolder; private transient BeanProcessor processor; - @UriPath(label = "common", description = "Sets the name of the bean to invoke") + @UriPath(label = "common", + description = "The name of the bean to invoke. The bean component looks it up in the Camel registry and," + + " when no bean has that name, takes it as a class name and creates an instance." + + " The class component takes it as the fully qualified class name.") @Metadata(required = true) private String beanName; - @UriParam(label = "common", description = "Sets the name of the method to invoke on the bean") + @UriParam(label = "common", + description = "The name of the method to invoke on the bean. When not set, Camel chooses the method with" + + " the bean binding rules, for example the method annotated with @Handler or the method" + + " whose parameter matches the message body. Parameters can follow in parentheses, as types" + + " to choose among overloaded methods, such as foo(String), or as values to bind, such as" + + " foo(${body}, true).") private String method; - @UriParam(label = "common", defaultValue = "Singleton", description = "Scope of bean." - + " When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint." - + " The bean should be thread-safe in case concurrent threads is calling the bean at the same time." - + " When using request scope the bean is created or looked up once per request (exchange). This can be used if you want to store state on a bean" - + " while processing a request and you want to call the same bean instance multiple times while processing the request." - + " The bean does not have to be thread-safe as the instance is only called from the same request." - + " When using prototype scope, then the bean will be looked up or created per call. However in case of lookup then this is delegated " - + " to the bean registry such as Spring or CDI (if in use), which depends on their configuration can act as either singleton or prototype scope." - + " so when using prototype then this depends on the delegated registry.") + @UriParam(label = "common", defaultValue = "Singleton", + description = "How long a bean instance is reused. Singleton: the bean is looked up or created once and" + + " used for the lifetime of the endpoint, so it must be thread-safe. Request: one instance per" + + " exchange, so the bean can keep state while the same exchange calls it several times." + + " Prototype: the bean is looked up or created on each call, and a bean from a registry such as" + + " Spring or CDI is a new instance only when that registry creates one.") private BeanScope scope = BeanScope.Singleton; - @UriParam(prefix = "bean.", label = "advanced", description = "Used for configuring additional properties on the bean", - multiValue = true) + @UriParam(prefix = "bean.", label = "advanced", multiValue = true, + description = "Properties to set on the bean, each given with the bean. prefix: bean.timeout=5000 calls" + + " setTimeout(5000) on the bean. The properties are set each time the bean is looked up or" + + " created, once for Singleton scope, so a bean from the registry is changed for every user" + + " of it.") private Map<String, Object> parameters; public BeanEndpoint() { diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java b/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java index 0983f49a4d08..f67f780cfa30 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java @@ -25,7 +25,7 @@ import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; /** - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. */ @UriEndpoint(firstVersion = "2.4.0", scheme = "class", title = "Class", syntax = "class:beanName", producerOnly = true, remote = false, category = { Category.CORE, Category.SCRIPT }) diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 5ca0ab7dd1d8..f3be60f935e7 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -992,7 +992,8 @@ public interface ComponentsBuilderFactory { } /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry + * or created from a class name. * * Category: core,script * Since: 1.0 @@ -1165,7 +1166,7 @@ public interface ComponentsBuilderFactory { } /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Category: core,script * Since: 2.4 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BeanComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BeanComponentBuilderFactory.java index 4c8c029ab30a..58adf7732ebd 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BeanComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/BeanComponentBuilderFactory.java @@ -24,7 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.bean.BeanComponent; /** - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry or + * created from a class name. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,7 +34,8 @@ public interface BeanComponentBuilderFactory { /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry + * or created from a class name. * * Category: core,script * Since: 1.0 @@ -77,20 +79,10 @@ public interface BeanComponentBuilderFactory { /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * delegate scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * The scope that the endpoints use when they do not set their own scope + * option. Singleton looks up or creates the bean once per endpoint, so + * it must be thread-safe. Request uses one instance per exchange, and + * Prototype looks up or creates the bean on each call. * * The option is a: <code>org.apache.camel.BeanScope</code> * type. @@ -130,8 +122,10 @@ public interface BeanComponentBuilderFactory { /** - * Maximum cache size of internal cache for bean introspection. Setting - * a value of 0 or negative will disable the cache. + * The maximum number of entries in the cache of bean introspection + * results (the methods that Camel finds by reflection on a bean class). + * The cache of the bean component is also used by the class component + * and the bean language. A value of 0 or less disables the cache. * * The option is a: <code>int</code> type. * diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ClasComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ClasComponentBuilderFactory.java index bdb1cd25ae30..794b42417cee 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ClasComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/ClasComponentBuilderFactory.java @@ -24,7 +24,7 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.beanclass.ClassComponent; /** - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,7 +33,7 @@ public interface ClasComponentBuilderFactory { /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Category: core,script * Since: 2.4 @@ -77,20 +77,10 @@ public interface ClasComponentBuilderFactory { /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * delegate scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * The scope that the endpoints use when they do not set their own scope + * option. Singleton looks up or creates the bean once per endpoint, so + * it must be thread-safe. Request uses one instance per exchange, and + * Prototype looks up or creates the bean on each call. * * The option is a: <code>org.apache.camel.BeanScope</code> * type. @@ -130,8 +120,10 @@ public interface ClasComponentBuilderFactory { /** - * Maximum cache size of internal cache for bean introspection. Setting - * a value of 0 or negative will disable the cache. + * The maximum number of entries in the cache of bean introspection + * results (the methods that Camel finds by reflection on a bean class). + * The cache of the bean component is also used by the class component + * and the bean language. A value of 0 or less disables the cache. * * The option is a: <code>int</code> type. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 8810fc38a351..9023cb1b5040 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -3184,7 +3184,8 @@ public class StaticEndpointBuilders { } /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry + * or created from a class name. * * Category: core,script * Since: 1.0 @@ -3193,7 +3194,10 @@ public class StaticEndpointBuilders { * Syntax: <code>bean:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class name + * and creates an instance. The class component takes it as the fully + * qualified class name. * * @param path beanName * @return the dsl builder @@ -3203,7 +3207,8 @@ public class StaticEndpointBuilders { } /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry + * or created from a class name. * * Category: core,script * Since: 1.0 @@ -3212,7 +3217,10 @@ public class StaticEndpointBuilders { * Syntax: <code>bean:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class name + * and creates an instance. The class component takes it as the fully + * qualified class name. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -3806,7 +3814,7 @@ public class StaticEndpointBuilders { } /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Category: core,script * Since: 2.4 @@ -3815,7 +3823,10 @@ public class StaticEndpointBuilders { * Syntax: <code>class:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class name + * and creates an instance. The class component takes it as the fully + * qualified class name. * * @param path beanName * @return the dsl builder @@ -3825,7 +3836,7 @@ public class StaticEndpointBuilders { } /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Category: core,script * Since: 2.4 @@ -3834,7 +3845,10 @@ public class StaticEndpointBuilders { * Syntax: <code>class:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class name + * and creates an instance. The class component takes it as the fully + * qualified class name. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BeanEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BeanEndpointBuilderFactory.java index d82439fe868b..16f7d62ef2a2 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BeanEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BeanEndpointBuilderFactory.java @@ -27,7 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel registry or + * created from a class name. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,7 +46,12 @@ public interface BeanEndpointBuilderFactory { } /** - * Sets the name of the method to invoke on the bean. + * The name of the method to invoke on the bean. When not set, Camel + * chooses the method with the bean binding rules, for example the + * method annotated with Handler or the method whose parameter matches + * the message body. Parameters can follow in parentheses, as types to + * choose among overloaded methods, such as foo(String), or as values to + * bind, such as foo(${body}, true). * * The option is a: <code>java.lang.String</code> type. * @@ -59,20 +65,13 @@ public interface BeanEndpointBuilderFactory { return this; } /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * prototype scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * How long a bean instance is reused. Singleton: the bean is looked up + * or created once and used for the lifetime of the endpoint, so it must + * be thread-safe. Request: one instance per exchange, so the bean can + * keep state while the same exchange calls it several times. Prototype: + * the bean is looked up or created on each call, and a bean from a + * registry such as Spring or CDI is a new instance only when that + * registry creates one. * * The option is a: <code>org.apache.camel.BeanScope</code> type. * @@ -87,20 +86,13 @@ public interface BeanEndpointBuilderFactory { return this; } /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * prototype scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * How long a bean instance is reused. Singleton: the bean is looked up + * or created once and used for the lifetime of the endpoint, so it must + * be thread-safe. Request: one instance per exchange, so the bean can + * keep state while the same exchange calls it several times. Prototype: + * the bean is looked up or created on each call, and a bean from a + * registry such as Spring or CDI is a new instance only when that + * registry creates one. * * The option will be converted to a * <code>org.apache.camel.BeanScope</code> type. @@ -174,8 +166,11 @@ public interface BeanEndpointBuilderFactory { return this; } /** - * Used for configuring additional properties on the bean. This is a - * multi-value option with prefix: bean. + * Properties to set on the bean, each given with the bean. prefix: + * bean.timeout=5000 calls setTimeout(5000) on the bean. The properties + * are set each time the bean is looked up or created, once for + * Singleton scope, so a bean from the registry is changed for every + * user of it. This is a multi-value option with prefix: bean. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type. @@ -194,8 +189,11 @@ public interface BeanEndpointBuilderFactory { return this; } /** - * Used for configuring additional properties on the bean. This is a - * multi-value option with prefix: bean. + * Properties to set on the bean, each given with the bean. prefix: + * bean.timeout=5000 calls setTimeout(5000) on the bean. The properties + * are set each time the bean is looked up or created, once for + * Singleton scope, so a bean from the registry is changed for every + * user of it. This is a multi-value option with prefix: bean. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type. @@ -217,7 +215,8 @@ public interface BeanEndpointBuilderFactory { public interface BeanBuilders { /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel + * registry or created from a class name. * * Category: core,script * Since: 1.0 @@ -226,7 +225,10 @@ public interface BeanEndpointBuilderFactory { * Syntax: <code>bean:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class + * name and creates an instance. The class component takes it as the + * fully qualified class name. * * @param path beanName * @return the dsl builder @@ -236,7 +238,8 @@ public interface BeanEndpointBuilderFactory { } /** * Bean (camel-bean) - * Invoke methods of Java beans stored in Camel registry. + * Invoke a method of a Java bean, looked up by name in the Camel + * registry or created from a class name. * * Category: core,script * Since: 1.0 @@ -245,7 +248,10 @@ public interface BeanEndpointBuilderFactory { * Syntax: <code>bean:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class + * name and creates an instance. The class component takes it as the + * fully qualified class name. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ClassEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ClassEndpointBuilderFactory.java index 8752be31a36e..d6c0d18c2130 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ClassEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ClassEndpointBuilderFactory.java @@ -27,7 +27,7 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class name. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,7 +45,12 @@ public interface ClassEndpointBuilderFactory { } /** - * Sets the name of the method to invoke on the bean. + * The name of the method to invoke on the bean. When not set, Camel + * chooses the method with the bean binding rules, for example the + * method annotated with Handler or the method whose parameter matches + * the message body. Parameters can follow in parentheses, as types to + * choose among overloaded methods, such as foo(String), or as values to + * bind, such as foo(${body}, true). * * The option is a: <code>java.lang.String</code> type. * @@ -59,20 +64,13 @@ public interface ClassEndpointBuilderFactory { return this; } /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * prototype scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * How long a bean instance is reused. Singleton: the bean is looked up + * or created once and used for the lifetime of the endpoint, so it must + * be thread-safe. Request: one instance per exchange, so the bean can + * keep state while the same exchange calls it several times. Prototype: + * the bean is looked up or created on each call, and a bean from a + * registry such as Spring or CDI is a new instance only when that + * registry creates one. * * The option is a: <code>org.apache.camel.BeanScope</code> type. * @@ -87,20 +85,13 @@ public interface ClassEndpointBuilderFactory { return this; } /** - * Scope of bean. When using singleton scope (default) the bean is - * created or looked up only once and reused for the lifetime of the - * endpoint. The bean should be thread-safe in case concurrent threads - * is calling the bean at the same time. When using request scope the - * bean is created or looked up once per request (exchange). This can be - * used if you want to store state on a bean while processing a request - * and you want to call the same bean instance multiple times while - * processing the request. The bean does not have to be thread-safe as - * the instance is only called from the same request. When using - * prototype scope, then the bean will be looked up or created per call. - * However in case of lookup then this is delegated to the bean registry - * such as Spring or CDI (if in use), which depends on their - * configuration can act as either singleton or prototype scope. so when - * using prototype then this depends on the delegated registry. + * How long a bean instance is reused. Singleton: the bean is looked up + * or created once and used for the lifetime of the endpoint, so it must + * be thread-safe. Request: one instance per exchange, so the bean can + * keep state while the same exchange calls it several times. Prototype: + * the bean is looked up or created on each call, and a bean from a + * registry such as Spring or CDI is a new instance only when that + * registry creates one. * * The option will be converted to a * <code>org.apache.camel.BeanScope</code> type. @@ -174,8 +165,11 @@ public interface ClassEndpointBuilderFactory { return this; } /** - * Used for configuring additional properties on the bean. This is a - * multi-value option with prefix: bean. + * Properties to set on the bean, each given with the bean. prefix: + * bean.timeout=5000 calls setTimeout(5000) on the bean. The properties + * are set each time the bean is looked up or created, once for + * Singleton scope, so a bean from the registry is changed for every + * user of it. This is a multi-value option with prefix: bean. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type. @@ -194,8 +188,11 @@ public interface ClassEndpointBuilderFactory { return this; } /** - * Used for configuring additional properties on the bean. This is a - * multi-value option with prefix: bean. + * Properties to set on the bean, each given with the bean. prefix: + * bean.timeout=5000 calls setTimeout(5000) on the bean. The properties + * are set each time the bean is looked up or created, once for + * Singleton scope, so a bean from the registry is changed for every + * user of it. This is a multi-value option with prefix: bean. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type. @@ -217,7 +214,8 @@ public interface ClassEndpointBuilderFactory { public interface ClassBuilders { /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class + * name. * * Category: core,script * Since: 2.4 @@ -226,7 +224,10 @@ public interface ClassEndpointBuilderFactory { * Syntax: <code>class:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class + * name and creates an instance. The class component takes it as the + * fully qualified class name. * * @param path beanName * @return the dsl builder @@ -236,7 +237,8 @@ public interface ClassEndpointBuilderFactory { } /** * Class (camel-bean) - * Invoke methods of Java beans specified by class name. + * Invoke a method of a Java bean given by its fully qualified class + * name. * * Category: core,script * Since: 2.4 @@ -245,7 +247,10 @@ public interface ClassEndpointBuilderFactory { * Syntax: <code>class:beanName</code> * * Path parameter: beanName (required) - * Sets the name of the bean to invoke + * The name of the bean to invoke. The bean component looks it up in the + * Camel registry and, when no bean has that name, takes it as a class + * name and creates an instance. The class component takes it as the + * fully qualified class name. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index 3accea39a8ad..55347462d522 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -119,7 +119,7 @@ or removes its row. | camel-azure-storage-blob | azure-storage-blob | | | camel-azure-storage-datalake | azure-storage-datalake | | | camel-azure-storage-queue | azure-storage-queue | yes | -| camel-bean | bean, class | | +| camel-bean | bean, class | yes | | camel-bean-validator | bean-validator | | | camel-bonita | bonita | yes | | camel-box | box | |
