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 c5eeb1b6d388a75097baf81d2478e368c47f9b59 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Feb 24 14:32:21 2023 +0100 CAMEL-19090: Remove deprecated apis in core --- .../org/apache/camel/catalog/components/bean.json | 2 - .../org/apache/camel/catalog/components/class.json | 2 - .../camel/component/dummy/DummyEndpoint.java | 3 +- .../component/bean/BeanComponentConfigurer.java | 3 - .../component/bean/BeanEndpointConfigurer.java | 3 - .../component/bean/BeanEndpointUriFactory.java | 3 +- .../beanclass/ClassEndpointUriFactory.java | 3 +- .../org/apache/camel/component/bean/bean.json | 2 - .../apache/camel/component/beanclass/class.json | 2 - .../apache/camel/component/bean/BeanComponent.java | 20 ---- .../apache/camel/component/bean/BeanConstants.java | 2 - .../apache/camel/component/bean/BeanEndpoint.java | 17 ---- .../bean/PojoMessageInvocationHandler.java | 51 ---------- .../camel/component/bean/PojoProxyHelper.java | 43 --------- .../camel/component/cxf/jaxrs/CxfRsEndpoint.java | 5 +- .../component/dataformat/DataFormatEndpoint.java | 3 +- .../camel/component/file/remote/FtpsEndpoint.java | 3 +- .../camel/component/file/remote/SftpEndpoint.java | 3 +- .../bigquery/sql/GoogleBigQuerySQLEndpoint.java | 3 +- .../OpenshiftBuildConfigsEndpoint.java | 3 +- .../component/sql/stored/SqlStoredEndpoint.java | 8 +- .../org/apache/camel/component/xj/XJEndpoint.java | 3 +- .../component/xmlsecurity/XmlVerifierEndpoint.java | 3 +- .../apache/camel/component/xslt/XsltEndpoint.java | 3 +- .../java/org/apache/camel/spi/UriEndpoint.java | 19 +--- .../java/org/apache/camel/health/HealthCheck.java | 7 -- .../org/apache/camel/model/BeanDefinition.java | 21 ----- .../camel/component/bean/BeanEndpointTest.java | 30 ------ .../camel/component/bean/pojomessage/Person.java | 33 ------- .../pojomessage/PojoProxyHelperOneWayTest.java | 73 --------------- .../PojoProxyHelperRequestReplyTest.java | 61 ------------ .../camel/impl/VanillaUuidGeneratorTest.java | 56 ----------- .../processor/BeanCachedProcessorGlobalTest.java | 40 -------- .../org/apache/camel/processor/BeanCachedTest.java | 103 --------------------- .../org/apache/camel/util/PlatformHelperTest.java | 49 ---------- .../camel/impl/health/AbstractHealthCheck.java | 4 - .../camel/impl/health/ConsumerHealthCheck.java | 1 - .../apache/camel/support/LocalBeanRegistry.java | 16 ---- .../org/apache/camel/support/PlatformHelper.java | 54 ----------- .../support/ScheduledPollConsumerHealthCheck.java | 1 - .../apache/camel/support/VanillaUuidGenerator.java | 53 ----------- .../org/apache/camel/support/jndi/JndiContext.java | 8 -- .../ROOT/pages/camel-4-migration-guide.adoc | 1 + .../component/dsl/BeanComponentBuilderFactory.java | 17 ---- .../component/dsl/ClasComponentBuilderFactory.java | 17 ---- .../endpoint/dsl/BeanEndpointBuilderFactory.java | 31 ------- .../endpoint/dsl/ClassEndpointBuilderFactory.java | 31 ------- .../packaging/EndpointSchemaGeneratorMojo.java | 4 +- .../java/org/apache/camel/spi/UriEndpoint.java | 19 +--- 49 files changed, 35 insertions(+), 907 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 fdae82db103..5c9bf813329 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 @@ -22,7 +22,6 @@ "lenientProperties": false }, "componentProperties": { - "cache": { "kind": "property", "displayName": "Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "true", "description": "Use singleton option instead." }, "lazyStartProducer": { "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 during star [...] "scope": { "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "object", "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 thread-sa [...] "autowiredEnabled": { "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 type, which t [...] @@ -32,7 +31,6 @@ }, "properties": { "beanName": { "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "cache": { "kind": "parameter", "displayName": "Cache", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "description": "Use scope option instead." }, "method": { "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": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "object", "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 thre [...] "lazyStartProducer": { "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 producer may other [...] 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 91294473f5e..9989b91dc0a 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 @@ -22,7 +22,6 @@ "lenientProperties": false }, "componentProperties": { - "cache": { "kind": "property", "displayName": "Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "true", "description": "Use singleton option instead." }, "lazyStartProducer": { "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 during star [...] "scope": { "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "object", "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 thread-sa [...] "autowiredEnabled": { "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 type, which t [...] @@ -32,7 +31,6 @@ }, "properties": { "beanName": { "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "cache": { "kind": "parameter", "displayName": "Cache", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "description": "Use scope option instead." }, "method": { "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": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "object", "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 thre [...] "lazyStartProducer": { "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 producer may other [...] diff --git a/catalog/dummy-component/src/main/java/org/apache/camel/component/dummy/DummyEndpoint.java b/catalog/dummy-component/src/main/java/org/apache/camel/component/dummy/DummyEndpoint.java index 36364167d83..80789a50e6b 100644 --- a/catalog/dummy-component/src/main/java/org/apache/camel/component/dummy/DummyEndpoint.java +++ b/catalog/dummy-component/src/main/java/org/apache/camel/component/dummy/DummyEndpoint.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.dummy; +import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.Consumer; import org.apache.camel.Processor; @@ -26,7 +27,7 @@ import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; import org.apache.camel.support.DefaultEndpoint; -@UriEndpoint(scheme = "dummy", syntax = "dummy:drink", title = "Dummy", label = "bar", producerOnly = true) +@UriEndpoint(scheme = "dummy", syntax = "dummy:drink", title = "Dummy", category = { Category.TESTING }, producerOnly = true) public class DummyEndpoint extends DefaultEndpoint { @UriPath diff --git a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanComponentConfigurer.java b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanComponentConfigurer.java index 2494ab5f627..d508722a03d 100644 --- a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanComponentConfigurer.java +++ b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanComponentConfigurer.java @@ -23,7 +23,6 @@ public class BeanComponentConfigurer extends PropertyConfigurerSupport implement switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true; - case "cache": target.setCache(property(camelContext, java.lang.Boolean.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "scope": target.setScope(property(camelContext, org.apache.camel.BeanScope.class, value)); return true; @@ -36,7 +35,6 @@ public class BeanComponentConfigurer extends PropertyConfigurerSupport implement switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": return boolean.class; - case "cache": return java.lang.Boolean.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "scope": return org.apache.camel.BeanScope.class; @@ -50,7 +48,6 @@ public class BeanComponentConfigurer extends PropertyConfigurerSupport implement switch (ignoreCase ? name.toLowerCase() : name) { case "autowiredenabled": case "autowiredEnabled": return target.isAutowiredEnabled(); - case "cache": return target.getCache(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "scope": return target.getScope(); diff --git a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointConfigurer.java b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointConfigurer.java index bab4a14c9e9..30f380c629c 100644 --- a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointConfigurer.java +++ b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointConfigurer.java @@ -21,7 +21,6 @@ public class BeanEndpointConfigurer extends PropertyConfigurerSupport implements public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { BeanEndpoint target = (BeanEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { - case "cache": target.setCache(property(camelContext, java.lang.Boolean.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "method": target.setMethod(property(camelContext, java.lang.String.class, value)); return true; @@ -34,7 +33,6 @@ public class BeanEndpointConfigurer extends PropertyConfigurerSupport implements @Override public Class<?> getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { - case "cache": return java.lang.Boolean.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "method": return java.lang.String.class; @@ -48,7 +46,6 @@ public class BeanEndpointConfigurer extends PropertyConfigurerSupport implements public Object getOptionValue(Object obj, String name, boolean ignoreCase) { BeanEndpoint target = (BeanEndpoint) obj; switch (ignoreCase ? name.toLowerCase() : name) { - case "cache": return target.getCache(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "method": return target.getMethod(); diff --git a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointUriFactory.java b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointUriFactory.java index 76993f77301..202edd37188 100644 --- a/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointUriFactory.java +++ b/components/camel-bean/src/generated/java/org/apache/camel/component/bean/BeanEndpointUriFactory.java @@ -21,9 +21,8 @@ public class BeanEndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> SECRET_PROPERTY_NAMES; private static final Set<String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(6); + Set<String> props = new HashSet<>(5); props.add("beanName"); - props.add("cache"); props.add("lazyStartProducer"); props.add("method"); props.add("parameters"); diff --git a/components/camel-bean/src/generated/java/org/apache/camel/component/beanclass/ClassEndpointUriFactory.java b/components/camel-bean/src/generated/java/org/apache/camel/component/beanclass/ClassEndpointUriFactory.java index 0eee1bf1408..8f19cbb9202 100644 --- a/components/camel-bean/src/generated/java/org/apache/camel/component/beanclass/ClassEndpointUriFactory.java +++ b/components/camel-bean/src/generated/java/org/apache/camel/component/beanclass/ClassEndpointUriFactory.java @@ -21,9 +21,8 @@ public class ClassEndpointUriFactory extends org.apache.camel.support.component. private static final Set<String> SECRET_PROPERTY_NAMES; private static final Set<String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(6); + Set<String> props = new HashSet<>(5); props.add("beanName"); - props.add("cache"); props.add("lazyStartProducer"); props.add("method"); props.add("parameters"); diff --git a/components/camel-bean/src/generated/resources/org/apache/camel/component/bean/bean.json b/components/camel-bean/src/generated/resources/org/apache/camel/component/bean/bean.json index fdae82db103..5c9bf813329 100644 --- a/components/camel-bean/src/generated/resources/org/apache/camel/component/bean/bean.json +++ b/components/camel-bean/src/generated/resources/org/apache/camel/component/bean/bean.json @@ -22,7 +22,6 @@ "lenientProperties": false }, "componentProperties": { - "cache": { "kind": "property", "displayName": "Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "true", "description": "Use singleton option instead." }, "lazyStartProducer": { "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 during star [...] "scope": { "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "object", "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 thread-sa [...] "autowiredEnabled": { "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 type, which t [...] @@ -32,7 +31,6 @@ }, "properties": { "beanName": { "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "cache": { "kind": "parameter", "displayName": "Cache", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "description": "Use scope option instead." }, "method": { "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": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "object", "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 thre [...] "lazyStartProducer": { "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 producer may other [...] diff --git a/components/camel-bean/src/generated/resources/org/apache/camel/component/beanclass/class.json b/components/camel-bean/src/generated/resources/org/apache/camel/component/beanclass/class.json index 91294473f5e..9989b91dc0a 100644 --- a/components/camel-bean/src/generated/resources/org/apache/camel/component/beanclass/class.json +++ b/components/camel-bean/src/generated/resources/org/apache/camel/component/beanclass/class.json @@ -22,7 +22,6 @@ "lenientProperties": false }, "componentProperties": { - "cache": { "kind": "property", "displayName": "Cache", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "true", "description": "Use singleton option instead." }, "lazyStartProducer": { "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 during star [...] "scope": { "kind": "property", "displayName": "Scope", "group": "producer", "label": "", "required": false, "type": "object", "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 thread-sa [...] "autowiredEnabled": { "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 type, which t [...] @@ -32,7 +31,6 @@ }, "properties": { "beanName": { "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, - "cache": { "kind": "parameter", "displayName": "Cache", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "autowired": false, "secret": false, "description": "Use scope option instead." }, "method": { "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": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "common", "required": false, "type": "object", "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 thre [...] "lazyStartProducer": { "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 producer may other [...] 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 1c588e26e91..fd8082be7e1 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,9 +41,6 @@ public class BeanComponent extends DefaultComponent { @SuppressWarnings("unchecked") private final Map<BeanInfoCacheKey, BeanInfo> beanInfoCache = LRUCacheFactory.newLRUSoftCache(1000); - @Deprecated - @Metadata(defaultValue = "true", description = "Use singleton option instead.") - private Boolean cache; @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." @@ -64,9 +61,6 @@ public class BeanComponent extends DefaultComponent { protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { BeanEndpoint endpoint = new BeanEndpoint(uri, this); endpoint.setBeanName(remaining); - if (cache != null) { - endpoint.setCache(cache); - } endpoint.setScope(scope); setProperties(endpoint, parameters); @@ -94,20 +88,6 @@ public class BeanComponent extends DefaultComponent { beanInfoCache.clear(); } - @Deprecated - public Boolean getCache() { - return scope == BeanScope.Singleton; - } - - @Deprecated - public void setCache(Boolean cache) { - if (Boolean.TRUE.equals(cache)) { - scope = BeanScope.Singleton; - } else { - scope = BeanScope.Prototype; - } - } - public BeanScope getScope() { return scope; } diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanConstants.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanConstants.java index dac73c83048..2048da17e9c 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanConstants.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanConstants.java @@ -21,8 +21,6 @@ import org.apache.camel.spi.Metadata; public final class BeanConstants { - @Deprecated - public static final String BEAN_PARAMETER_MAPPING_STRATEGY = "CamelBeanParameterMappingStrategy"; @Metadata(description = "The name of the method to invoke.", javaType = "String") public static final String BEAN_METHOD_NAME = Exchange.BEAN_METHOD_NAME; 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 5739e67c79b..26aad6580c7 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 @@ -44,9 +44,6 @@ public class BeanEndpoint extends DefaultEndpoint { private String beanName; @UriParam(label = "common", description = "Sets the name of the method to invoke on the bean") private String method; - @Deprecated - @UriParam(label = "common", description = "Use scope option instead.") - private Boolean cache; @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." @@ -141,20 +138,6 @@ public class BeanEndpoint extends DefaultEndpoint { this.beanName = beanName; } - @Deprecated - public Boolean getCache() { - return scope == BeanScope.Singleton; - } - - @Deprecated - public void setCache(Boolean cache) { - if (Boolean.TRUE.equals(cache)) { - scope = BeanScope.Singleton; - } else { - scope = BeanScope.Prototype; - } - } - public BeanScope getScope() { return scope; } diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoMessageInvocationHandler.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoMessageInvocationHandler.java deleted file mode 100644 index 178ae682ea4..00000000000 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoMessageInvocationHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.bean; - -import java.lang.reflect.Method; - -import org.apache.camel.Endpoint; -import org.apache.camel.ExchangePattern; -import org.apache.camel.Producer; -import org.apache.camel.RuntimeCamelException; - -/** - * Special {@link java.lang.reflect.InvocationHandler} for methods that have only one parameter. This parameter is - * directly sent to as the body of the message. The idea is to use that as a very open message format especially when - * combined with e.g. JAXB serialization. - */ -@Deprecated -public class PojoMessageInvocationHandler extends AbstractCamelInvocationHandler { - - public PojoMessageInvocationHandler(Endpoint endpoint, Producer producer) { - super(endpoint, producer); - } - - @Override - public Object doInvokeProxy(Object proxy, Method method, Object[] args) throws Throwable { - int argsLength = (args == null) ? 0 : args.length; - if (argsLength != 1) { - throw new RuntimeCamelException( - String.format("Error creating proxy for %s.%s Number of arguments must be 1 but is %d", - method.getDeclaringClass().getName(), - method.getName(), argsLength)); - } - final ExchangePattern pattern = method.getReturnType() != Void.TYPE ? ExchangePattern.InOut : ExchangePattern.InOnly; - return invokeWithBody(method, args[0], pattern); - } - -} diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoProxyHelper.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoProxyHelper.java deleted file mode 100644 index f759cac3380..00000000000 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/PojoProxyHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.bean; - -import java.lang.reflect.Proxy; - -import org.apache.camel.Endpoint; -import org.apache.camel.Producer; -import org.apache.camel.support.service.ServiceHelper; - -/** - * Create a dynamic proxy for a given interface and endpoint that sends the parameter object to the endpoint and - * optionally receives a reply. Unlike the ProxyHelper this works only with methods that have only one parameter. - */ -@Deprecated -public final class PojoProxyHelper { - - private PojoProxyHelper() { - } - - @SuppressWarnings("unchecked") - public static <T> T createProxy(Endpoint endpoint, Class<?>... interfaceClasses) throws Exception { - Producer producer = endpoint.createProducer(); - // ensure the producer is started - ServiceHelper.startService(producer); - return (T) Proxy.newProxyInstance(ProxyHelper.getClassLoader(interfaceClasses), interfaceClasses.clone(), - new PojoMessageInvocationHandler(endpoint, producer)); - } -} diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java index 778f20e2b2a..a8c7a5d8c1b 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java @@ -26,6 +26,7 @@ import java.util.Map; import javax.net.ssl.HostnameVerifier; +import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.Consumer; import org.apache.camel.Processor; @@ -68,8 +69,8 @@ import static org.apache.camel.component.cxf.common.message.CxfConstants.SCHEME_ /** * Expose JAX-RS REST services using Apache CXF or connect to external REST services using CXF REST client. */ -@UriEndpoint(firstVersion = "2.0.0", scheme = SCHEME_CXF_RS, title = "CXF-RS", syntax = "cxfrs:beanId:address", label = "rest", - lenientProperties = true, headersClass = CxfConstants.class) +@UriEndpoint(firstVersion = "2.0.0", scheme = SCHEME_CXF_RS, title = "CXF-RS", syntax = "cxfrs:beanId:address", + category = {Category.REST}, lenientProperties = true, headersClass = CxfConstants.class) public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, Service { private static final Logger LOG = LoggerFactory.getLogger(CxfRsEndpoint.class); diff --git a/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java b/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java index 3de95ca3660..991f617b835 100644 --- a/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java +++ b/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java @@ -18,6 +18,7 @@ package org.apache.camel.component.dataformat; import org.apache.camel.AsyncCallback; import org.apache.camel.AsyncProcessor; +import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.Consumer; import org.apache.camel.Exchange; @@ -38,7 +39,7 @@ import org.apache.camel.support.service.ServiceHelper; */ @UriEndpoint(firstVersion = "2.12.0", scheme = "dataformat", title = "Data Format", syntax = "dataformat:name:operation", producerOnly = true, - label = "core,transformation", lenientProperties = true) + category = {Category.CORE, Category.TRANSFORMATION}, lenientProperties = true) public class DataFormatEndpoint extends DefaultEndpoint { private AsyncProcessor processor; diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java index 736e3587ada..b550e235417 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsEndpoint.java @@ -27,6 +27,7 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManagerFactory; +import org.apache.camel.Category; import org.apache.camel.api.management.ManagedResource; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -45,7 +46,7 @@ import org.slf4j.LoggerFactory; */ @UriEndpoint(firstVersion = "2.2.0", scheme = "ftps", extendsScheme = "file", title = "FTPS", syntax = "ftps:host:port/directoryName", alternativeSyntax = "ftps:username:password@host:port/directoryName", - label = "file", headersClass = FtpConstants.class) + category = { Category.FILE }, headersClass = FtpConstants.class) @Metadata(excludeProperties = "appendChars,readLockIdempotentReleaseAsync,readLockIdempotentReleaseAsyncPoolSize," + "readLockIdempotentReleaseDelay,readLockIdempotentReleaseExecutorService," + "directoryMustExist,extendedAttributes,probeContentType,startingDirectoryMustExist," diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java index a1e660814f7..7c3bda7a0e8 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java @@ -17,6 +17,7 @@ package org.apache.camel.component.file.remote; import com.jcraft.jsch.Proxy; +import org.apache.camel.Category; import org.apache.camel.Processor; import org.apache.camel.component.file.GenericFileConfiguration; import org.apache.camel.component.file.GenericFileProcessStrategy; @@ -31,7 +32,7 @@ import org.apache.camel.spi.UriParam; * Upload and download files to/from SFTP servers. */ @UriEndpoint(firstVersion = "1.1.0", scheme = "sftp", extendsScheme = "file", title = "SFTP", - syntax = "sftp:host:port/directoryName", label = "file", headersClass = FtpConstants.class) + syntax = "sftp:host:port/directoryName", category = { Category.FILE }, headersClass = FtpConstants.class) @Metadata(excludeProperties = "appendChars,bufferSize,siteCommand," + "directoryMustExist,extendedAttributes,probeContentType,startingDirectoryMustExist," + "startingDirectoryMustHaveAccess,forceWrites,copyAndDeleteOnRenameFail," diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java index 84dd172ed43..9e7847c0c91 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java @@ -17,6 +17,7 @@ package org.apache.camel.component.google.bigquery.sql; import com.google.cloud.bigquery.BigQuery; +import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; @@ -41,7 +42,7 @@ import static org.apache.camel.component.google.bigquery.GoogleBigQueryConstants * handled by Camel. */ @UriEndpoint(firstVersion = "2.23.0", scheme = SCHEME_BIGQUERY_SQL, title = "Google BigQuery Standard SQL", - syntax = "google-bigquery-sql:projectId:queryString", label = "cloud,messaging", producerOnly = true, + syntax = "google-bigquery-sql:projectId:queryString", category = { Category.CLOUD, Category.MESSAGING }, producerOnly = true, headersClass = GoogleBigQueryConstants.class) public class GoogleBigQuerySQLEndpoint extends DefaultEndpoint { diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/openshift/build_configs/OpenshiftBuildConfigsEndpoint.java b/components/camel-kubernetes/src/main/java/org/apache/camel/component/openshift/build_configs/OpenshiftBuildConfigsEndpoint.java index 8e73961fd68..6779fd32e24 100644 --- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/openshift/build_configs/OpenshiftBuildConfigsEndpoint.java +++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/openshift/build_configs/OpenshiftBuildConfigsEndpoint.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.openshift.build_configs; +import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; @@ -30,7 +31,7 @@ import static org.apache.camel.component.kubernetes.KubernetesConstants.SCHEME_B * Perform operations on OpenShift Build Configs. */ @UriEndpoint(firstVersion = "2.17.0", scheme = SCHEME_BUILD_CONFIG, title = "Openshift Build Config", - syntax = "openshift-build-configs:masterUrl", producerOnly = true, label = "container,cloud,paas", + syntax = "openshift-build-configs:masterUrl", producerOnly = true, category = { Category.CONTAINER, Category.CLOUD, Category.PAAS }, headersClass = KubernetesConstants.class) public class OpenshiftBuildConfigsEndpoint extends AbstractKubernetesEndpoint { diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java index a7e6e08ad33..e5d14d19f7d 100644 --- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/SqlStoredEndpoint.java @@ -20,6 +20,7 @@ import java.util.Map; import javax.sql.DataSource; +import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; @@ -36,18 +37,17 @@ import org.springframework.jdbc.core.JdbcTemplate; * Perform SQL queries as a JDBC Stored Procedures using Spring JDBC. */ @UriEndpoint(firstVersion = "2.17.0", scheme = "sql-stored", title = "SQL Stored Procedure", syntax = "sql-stored:template", - producerOnly = true, label = "database,sql", headersClass = SqlStoredConstants.class) + producerOnly = true, category = { Category.DATABASE, Category.SQL }, headersClass = SqlStoredConstants.class) public class SqlStoredEndpoint extends DefaultEndpoint { private CallableStatementWrapperFactory wrapperFactory; private JdbcTemplate jdbcTemplate; - @UriParam(description = "Sets the DataSource to use to communicate with the database.") - private DataSource dataSource; - @UriPath(description = "Sets the StoredProcedure template to perform") @Metadata(required = true) private String template; + @UriParam(description = "Sets the DataSource to use to communicate with the database.") + private DataSource dataSource; @UriParam(description = "Enables or disables batch mode") private boolean batch; @UriParam(description = "Whether to use the message body as the template and then headers for parameters. If this option is enabled then the template in the uri is not used.") diff --git a/components/camel-xj/src/main/java/org/apache/camel/component/xj/XJEndpoint.java b/components/camel-xj/src/main/java/org/apache/camel/component/xj/XJEndpoint.java index e0716eee50e..d0470df003a 100644 --- a/components/camel-xj/src/main/java/org/apache/camel/component/xj/XJEndpoint.java +++ b/components/camel-xj/src/main/java/org/apache/camel/component/xj/XJEndpoint.java @@ -17,6 +17,7 @@ package org.apache.camel.component.xj; import com.fasterxml.jackson.core.JsonFactory; +import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.api.management.ManagedAttribute; import org.apache.camel.api.management.ManagedResource; @@ -32,7 +33,7 @@ import org.apache.camel.spi.UriParam; */ @ManagedResource(description = "Managed XJEndpoint") @UriEndpoint(firstVersion = "3.0.0", scheme = "xj", title = "XJ", syntax = "xj:resourceUri", producerOnly = true, - label = "transformation", headersClass = XJConstants.class) + category = { Category.TRANSFORMATION }, headersClass = XJConstants.class) public class XJEndpoint extends XsltSaxonEndpoint { private final JsonFactory jsonFactory = new JsonFactory(); diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java index b906cb6af57..b0d15acb751 100644 --- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java +++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlVerifierEndpoint.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.xmlsecurity; +import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; @@ -34,7 +35,7 @@ import static org.apache.camel.component.xmlsecurity.api.XmlSignatureConstants.S * Verify XML payloads using the XML signature specification. */ @UriEndpoint(firstVersion = "2.12.0", scheme = SCHEME_VERIFIER, title = "XML Security Verify", - syntax = "xmlsecurity-verify:name", producerOnly = true, label = "security,transformation", + syntax = "xmlsecurity-verify:name", producerOnly = true, category = { Category.SECURITY, Category.TRANSFORMATION }, headersClass = XmlSignatureConstants.class) public class XmlVerifierEndpoint extends DefaultEndpoint { diff --git a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java index 2285fcf2a4e..28b418c3cac 100644 --- a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java +++ b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java @@ -26,6 +26,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.URIResolver; +import org.apache.camel.Category; import org.xml.sax.EntityResolver; import org.apache.camel.CamelContext; @@ -52,7 +53,7 @@ import org.slf4j.LoggerFactory; */ @ManagedResource(description = "Managed XsltEndpoint") @UriEndpoint(firstVersion = "1.3.0", scheme = "xslt", title = "XSLT", syntax = "xslt:resourceUri", producerOnly = true, - label = "core,transformation", headersClass = XsltConstants.class) + category = {Category.CORE, Category.TRANSFORMATION}, headersClass = XsltConstants.class) public class XsltEndpoint extends ProcessorEndpoint { private static final Logger LOG = LoggerFactory.getLogger(XsltEndpoint.class); diff --git a/core/camel-api/src/generated/java/org/apache/camel/spi/UriEndpoint.java b/core/camel-api/src/generated/java/org/apache/camel/spi/UriEndpoint.java index 972bd7d96d2..f4d4855147d 100644 --- a/core/camel-api/src/generated/java/org/apache/camel/spi/UriEndpoint.java +++ b/core/camel-api/src/generated/java/org/apache/camel/spi/UriEndpoint.java @@ -98,25 +98,12 @@ public @interface UriEndpoint { String consumerPrefix() default ""; /** - * A human readable title of this entity, such as the component name of the this endpoint. + * A human-readable title of this entity, such as the component name of the this endpoint. * <p/> * For example: JMS, MQTT, Netty HTTP, SAP NetWeaver */ String title(); - /** - * To associate this endpoint with label(s). - * <p/> - * Multiple labels can be defined as a comma separated value. - * <p/> - * The labels is intended for grouping the endpoints, such as <tt>core</tt>, <tt>file</tt>, <tt>messaging</tt>, - * <tt>database</tt>, etc. - * <p/> - * Deprecated: Use the category field instead - */ - @Deprecated - String label() default ""; - /** * To associate this endpoint with category(ies). * <p/> @@ -130,14 +117,14 @@ public @interface UriEndpoint { /** * Whether this endpoint can only be used as a producer. * <p/> - * By default its assumed the endpoint can be used as both consumer and producer. + * By default, its assumed the endpoint can be used as both consumer and producer. */ boolean producerOnly() default false; /** * Whether this endpoint can only be used as a consumer. * <p/> - * By default its assumed the endpoint can be used as both consumer and producer. + * By default, its assumed the endpoint can be used as both consumer and producer. */ boolean consumerOnly() default false; diff --git a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java index f8244eb3fdb..78f66095a8f 100644 --- a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java +++ b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java @@ -35,8 +35,6 @@ public interface HealthCheck extends HasGroup, HasId, Ordered { String CHECK_ENABLED = "check.enabled"; String INVOCATION_COUNT = "invocation.count"; String INVOCATION_TIME = "invocation.time"; - @Deprecated - String INVOCATION_ATTEMPT_TIME = "invocation.attempt.time"; String FAILURE_COUNT = "failure.count"; String FAILURE_START_TIME = "failure.start.time"; String FAILURE_TIME = "failure.time"; @@ -46,11 +44,6 @@ public interface HealthCheck extends HasGroup, HasId, Ordered { String SUCCESS_START_TIME = "success.start.time"; String SUCCESS_TIME = "success.time"; String HTTP_RESPONSE_CODE = "http.response.code"; - /** - * Use ENDPOINT_URI - */ - @Deprecated - String FAILURE_ENDPOINT_URI = "failure.endpoint.uri"; enum State { UP, diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/BeanDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/BeanDefinition.java index f919b0f5141..9c5549eccd1 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/BeanDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/BeanDefinition.java @@ -149,27 +149,6 @@ public class BeanDefinition extends NoOutputDefinition<BeanDefinition> { this.beanClass = beanType; } - @Deprecated - public String getCache() { - if (scope == null || BeanScope.Singleton.name().equals(scope)) { - return "true"; - } else { - return "false"; - } - } - - /** - * Use singleton option instead - */ - @Deprecated - public void setCache(String cache) { - if ("true".equals(cache)) { - scope = BeanScope.Singleton.name(); - } else { - scope = BeanScope.Prototype.name(); - } - } - public String getScope() { return scope; } diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java index 42fa6cbb33f..f84ac72ee06 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanEndpointTest.java @@ -145,36 +145,6 @@ public class BeanEndpointTest extends ContextTestSupport { assertEquals("Hello World", out); } - @Test - public void testBeanEndpointCtrWithMethodAndCache() throws Exception { - final BeanEndpoint endpoint = new BeanEndpoint(); - endpoint.setCamelContext(context); - endpoint.setCache(true); - - endpoint.setBeanName("foo"); - endpoint.setMethod("hello"); - assertEquals("foo", endpoint.getBeanName()); - - assertTrue(endpoint.isSingleton()); - assertNull(endpoint.getBeanHolder()); - assertEquals("hello", endpoint.getMethod()); - assertEquals("bean:foo?method=hello", endpoint.getEndpointUri()); - - context.addRoutes(new RouteBuilder() { - @Override - public void configure() throws Exception { - from("direct:start").to(endpoint); - } - }); - context.start(); - - String out = template.requestBody("direct:start", "World", String.class); - assertEquals("Hello World", out); - - out = template.requestBody("direct:start", "Moon", String.class); - assertEquals("Hello Moon", out); - } - public static class FooBean { public String hello(String hello) { diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/Person.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/Person.java deleted file mode 100644 index 0d3a97f9449..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/Person.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.bean.pojomessage; - -public class Person { - String name; - - public Person() { - } - - public Person(String name) { - this.name = name; - } - - public String getName() { - return name; - } - -} diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperOneWayTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperOneWayTest.java deleted file mode 100644 index ccae3bc1668..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperOneWayTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.bean.pojomessage; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.camel.ContextTestSupport; -import org.apache.camel.Endpoint; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.bean.PojoProxyHelper; -import org.apache.camel.component.mock.MockEndpoint; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class PojoProxyHelperOneWayTest extends ContextTestSupport { - - PersonReceiver receiver = new PersonReceiver(); - - @Test - public void testOneWay() throws Exception { - Endpoint personEndpoint = context.getEndpoint("direct:person"); - MockEndpoint result = context.getEndpoint("mock:result", MockEndpoint.class); - Person person = new Person("Chris"); - result.expectedBodiesReceived(person); - PersonHandler sender = PojoProxyHelper.createProxy(personEndpoint, PersonHandler.class); - - sender.onPerson(person); - - result.assertIsSatisfied(); - assertEquals(1, receiver.receivedPersons.size()); - assertEquals(person.getName(), receiver.receivedPersons.get(0).getName()); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - - @Override - public void configure() throws Exception { - from("direct:person").to("mock:result").bean(receiver); - } - }; - } - - public static final class PersonReceiver implements PersonHandler { - public List<Person> receivedPersons = new ArrayList<>(); - - @Override - public void onPerson(Person person) { - receivedPersons.add(person); - } - } - - public interface PersonHandler { - void onPerson(Person person); - } -} diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperRequestReplyTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperRequestReplyTest.java deleted file mode 100644 index 160ac73535c..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/component/bean/pojomessage/PojoProxyHelperRequestReplyTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.bean.pojomessage; - -import org.apache.camel.ContextTestSupport; -import org.apache.camel.Endpoint; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.bean.PojoProxyHelper; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class PojoProxyHelperRequestReplyTest extends ContextTestSupport { - - PersonReceiver receiver = new PersonReceiver(); - - @Test - public void testRequestReply() throws Exception { - Endpoint personEndpoint = context.getEndpoint("direct:person"); - Person person = new Person("Chris"); - PersonHandler sender = PojoProxyHelper.createProxy(personEndpoint, PersonHandler.class); - - Person resultPerson = sender.onPerson(person); - assertEquals(person.getName() + "1", resultPerson.getName()); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:person").bean(receiver); - } - }; - } - - public static final class PersonReceiver implements PersonHandler { - @Override - public Person onPerson(Person person) { - return new Person(person.getName() + "1"); - } - } - - public interface PersonHandler { - Person onPerson(Person person); - } - -} diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/VanillaUuidGeneratorTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/VanillaUuidGeneratorTest.java deleted file mode 100644 index cbad0b25322..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/impl/VanillaUuidGeneratorTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.impl; - -import org.apache.camel.spi.UuidGenerator; -import org.apache.camel.support.VanillaUuidGenerator; -import org.apache.camel.util.StopWatch; -import org.apache.camel.util.TimeUtils; -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.jupiter.api.Assertions.assertNotSame; - -public class VanillaUuidGeneratorTest { - private static final Logger LOG = LoggerFactory.getLogger(VanillaUuidGeneratorTest.class); - - @Test - public void testGenerateUUID() { - UuidGenerator uuidGenerator = new VanillaUuidGenerator(); - - String firstUUID = uuidGenerator.generateUuid(); - String secondUUID = uuidGenerator.generateUuid(); - - assertNotSame(firstUUID, secondUUID); - } - - @Test - public void testPerformance() { - UuidGenerator uuidGenerator = new VanillaUuidGenerator(); - StopWatch watch = new StopWatch(); - - LOG.info("First id: {}", uuidGenerator.generateUuid()); - for (int i = 0; i < 500000; i++) { - uuidGenerator.generateUuid(); - } - LOG.info("Last id: {}", uuidGenerator.generateUuid()); - - LOG.info("Took {}", TimeUtils.printDuration(watch.taken(), true)); - } - -} diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedProcessorGlobalTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedProcessorGlobalTest.java deleted file mode 100644 index 2d0e52a0e3d..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedProcessorGlobalTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.processor; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.bean.BeanComponent; - -public class BeanCachedProcessorGlobalTest extends BeanCachedProcessorTest { - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - @Override - public void configure() { - // set global cache on bean - BeanComponent bean = getContext().getComponent("bean", BeanComponent.class); - bean.setCache(true); - - from("direct:noCache").to("bean:something?cache=false"); - from("direct:cached").to("bean:something"); - - } - }; - } - -} diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java deleted file mode 100644 index 4a02dab8c54..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/processor/BeanCachedTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.processor; - -import javax.naming.Context; - -import org.apache.camel.CamelExecutionException; -import org.apache.camel.ContextTestSupport; -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.spi.Registry; -import org.apache.camel.support.DefaultRegistry; -import org.apache.camel.support.jndi.JndiBeanRepository; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -@Deprecated -public class BeanCachedTest extends ContextTestSupport { - - private Context context; - - private Registry registry; - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - @Override - public void configure() { - from("direct:noCache").to("bean:something?cache=false"); - from("direct:cached").to("bean:something?cache=true"); - - } - }; - } - - @Override - protected Registry createRegistry() throws Exception { - context = createJndiContext(); - context.bind("something", new MyBean()); - registry = new DefaultRegistry(new JndiBeanRepository(context)); - return registry; - } - - @Test - public void testFreshBeanInContext() throws Exception { - // Just make sure the bean processor doesn't work if the cached is false - MyBean originalInstance = registry.lookupByNameAndType("something", MyBean.class); - template.sendBody("direct:noCache", null); - context.unbind("something"); - context.bind("something", new MyBean()); - // Make sure we can get the object from the registry - assertNotSame(registry.lookupByName("something"), originalInstance); - template.sendBody("direct:noCache", null); - } - - @Test - public void testBeanWithCached() throws Exception { - // Just make sure the bean processor doesn't work if the cached is false - MyBean originalInstance = registry.lookupByNameAndType("something", MyBean.class); - template.sendBody("direct:cached", null); - context.unbind("something"); - context.bind("something", new MyBean()); - // Make sure we can get the object from the registry - assertNotSame(registry.lookupByName("something"), originalInstance); - try { - template.sendBody("direct:cached", null); - fail("The IllegalStateException is expected"); - } catch (CamelExecutionException ex) { - boolean b = ex.getCause() instanceof IllegalStateException; - assertTrue(b, "IllegalStateException is expected!"); - assertEquals("This bean is not supported to be invoked again!", ex.getCause().getMessage()); - } - } - - public static class MyBean { - private boolean invoked; - - public void doSomething(Exchange exchange) throws Exception { - if (invoked) { - throw new IllegalStateException("This bean is not supported to be invoked again!"); - } else { - invoked = true; - } - - } - } - -} diff --git a/core/camel-core/src/test/java/org/apache/camel/util/PlatformHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/PlatformHelperTest.java deleted file mode 100644 index 0b6bcf1d2df..00000000000 --- a/core/camel-core/src/test/java/org/apache/camel/util/PlatformHelperTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.util; - -import org.apache.camel.impl.DefaultCamelContext; -import org.junit.jupiter.api.Test; - -import static org.apache.camel.support.PlatformHelper.isOsgiContext; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class PlatformHelperTest { - - @Test - public void shouldNotMatchDefaultCamelContext() { - assertFalse(isOsgiContext(new DefaultCamelContext())); - } - - @Test - public void shouldMatchBlueprintCamelContext() { - assertTrue(isOsgiContext(new BlueprintCamelContext())); - } - - @Test - public void shouldMatchOsgiDefaultCamelContext() { - assertTrue(isOsgiContext(new OsgiDefaultCamelContext())); - } - - private static class BlueprintCamelContext extends DefaultCamelContext { - } - - private static class OsgiDefaultCamelContext extends DefaultCamelContext { - } - -} diff --git a/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java b/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java index fbfd49bce66..0501cda4f37 100644 --- a/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java +++ b/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java @@ -160,12 +160,8 @@ public abstract class AbstractHealthCheck implements HealthCheck, CamelContextAw int successCount = (Integer) meta.getOrDefault(SUCCESS_COUNT, 0); String successTime = (String) meta.get(SUCCESS_TIME); String successStartTime = (String) meta.get(SUCCESS_START_TIME); - String invocationTime = ZonedDateTime.now().format(DateTimeFormatter.ISO_ZONED_DATE_TIME); - // Set common meta-data - meta.put(INVOCATION_ATTEMPT_TIME, invocationTime); - if (!isEnabled()) { LOG.debug("health-check ({}) {}/{} disabled", kind, getGroup(), getId()); builder.message("Disabled"); diff --git a/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumerHealthCheck.java b/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumerHealthCheck.java index 9b12da4a54e..988b6a03672 100644 --- a/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumerHealthCheck.java +++ b/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumerHealthCheck.java @@ -62,7 +62,6 @@ public class ConsumerHealthCheck extends RouteHealthCheck { // ensure to sanitize uri, so we do not show sensitive information such as passwords builder.detail(ENDPOINT_URI, sanitizedUri); - builder.detail(FAILURE_ENDPOINT_URI, sanitizedUri); builder.state(result.getState()); if (result.getMessage().isPresent()) { diff --git a/core/camel-support/src/main/java/org/apache/camel/support/LocalBeanRegistry.java b/core/camel-support/src/main/java/org/apache/camel/support/LocalBeanRegistry.java index d26845f611a..61e795472ab 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/LocalBeanRegistry.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/LocalBeanRegistry.java @@ -43,20 +43,4 @@ public final class LocalBeanRegistry extends SupplierRegistry { return Collections.unmodifiableSet(keySet()); } - /** - * Swaps the key which is used when this local registry have a number of bound beans that would clash with global - * registry or endpoint registry in Camel. Then there is a check that validates for clashes and then re-assign key - * names. - * - * @param oldKey the old key name - * @param newKey the new key name - * @deprecated not in use - */ - @Deprecated - public void swapKey(String oldKey, String newKey) { - Map<Class<?>, Object> value = remove(oldKey); - if (value != null) { - put(newKey, value); - } - } } diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PlatformHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/PlatformHelper.java deleted file mode 100644 index e79f386286d..00000000000 --- a/core/camel-support/src/main/java/org/apache/camel/support/PlatformHelper.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.support; - -import org.apache.camel.CamelContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Utility dedicated for resolving runtime information related to the platform on which Camel is currently running. - */ -@Deprecated -public final class PlatformHelper { - - private static final Logger LOG = LoggerFactory.getLogger(PlatformHelper.class); - - private PlatformHelper() { - } - - /** - * Determine whether Camel is OSGi-aware. Current implementation of the method checks if the name of the - * {@link CamelContext} matches the names of the known OSGi-aware contexts. - * - * @param camelContext context to be tested against OSGi-awareness - * @return true if given context is OSGi-aware, false otherwise - * @deprecated additional logic for OSGi should be in their own components in the camel-karaf project - */ - @Deprecated - public static boolean isOsgiContext(CamelContext camelContext) { - String contextType = camelContext.getClass().getSimpleName(); - if (contextType.startsWith("Osgi") || contextType.equals("BlueprintCamelContext")) { - LOG.trace("{} used - assuming running in the OSGi container.", contextType); - return true; - } else { - LOG.trace("{} used - assuming running in the OSGi container.", contextType); - return false; - } - } - -} diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java index 414860384f9..9426b97df4b 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java @@ -64,7 +64,6 @@ public class ScheduledPollConsumerHealthCheck implements HealthCheck { // ensure to sanitize uri, so we do not show sensitive information such as passwords builder.detail(ENDPOINT_URI, sanitizedUri); - builder.detail(FAILURE_ENDPOINT_URI, sanitizedUri); // what kind of check is this HealthCheck.Kind kind; diff --git a/core/camel-support/src/main/java/org/apache/camel/support/VanillaUuidGenerator.java b/core/camel-support/src/main/java/org/apache/camel/support/VanillaUuidGenerator.java deleted file mode 100644 index 9d985b3036b..00000000000 --- a/core/camel-support/src/main/java/org/apache/camel/support/VanillaUuidGenerator.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.support; - -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.atomic.AtomicLong; - -import org.apache.camel.spi.UuidGenerator; - -/** - * An implementation of the {@link UuidGenerator} that uses a random generated seed and a counter which increments by - * one. This generator is not unique per host or JVM. - * - * @deprecated this is now the default uuid generator in Camel 3.6 onwards. - */ -@Deprecated -public class VanillaUuidGenerator implements UuidGenerator { - private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray(); - - private final char[] seed - = (longToHex(new char[0], ThreadLocalRandom.current().nextLong()).substring(1) + "-").toCharArray(); - private final AtomicLong index = new AtomicLong(); - - @Override - public String generateUuid() { - return longToHex(seed, index.getAndIncrement()); - } - - private static String longToHex(char[] seed, long v) { - int l = seed.length; - char[] hexChars = new char[16 + seed.length]; - System.arraycopy(seed, 0, hexChars, 0, l); - for (int j = 15; j >= 0; j--) { - hexChars[l + j] = HEX_ARRAY[(int) (v & 0x0F)]; - v >>= 4; - } - return new String(hexChars); - } -} diff --git a/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java b/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java index 77e0386e38e..6bf7c6b01ed 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java @@ -38,8 +38,6 @@ import javax.naming.OperationNotSupportedException; import javax.naming.Reference; import javax.naming.spi.NamingManager; -import org.apache.camel.support.IntrospectionSupport; -import org.apache.camel.support.ObjectHelper; import org.apache.camel.util.CastUtils; /** @@ -436,10 +434,4 @@ public class JndiContext implements Context, Serializable { } } - @Deprecated - protected static Object createBean(Class<?> type, Map<String, Object> properties, String prefix) throws Exception { - Object value = ObjectHelper.newInstance(type); - IntrospectionSupport.setProperties(value, properties, prefix); - return value; - } } diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc index 74b6e7d24b6..3773f80e466 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc @@ -68,6 +68,7 @@ We have removed deprecated APIs such as the following: - Removed `@FallbackConverter` as you should use `@Converter(fallback = true)` instead. - Removed `uri` attribute on `@EndpointInject`, `@Produce`, and `@Consume` as you should use `value` (default) instead. For example `@Produce(uri = "kafka:cheese")` should be changed to `@Produce("kafka:cheese")` +- Removed `label` on `@UriEndpoint` as you should use `category` instead. == YAML DSL 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 4dec63aa0fd..31b09cb2c8b 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 @@ -48,22 +48,6 @@ public interface BeanComponentBuilderFactory { * Builder for the Bean component. */ interface BeanComponentBuilder extends ComponentBuilder<BeanComponent> { - /** - * Use singleton option instead. - * - * The option is a: <code>java.lang.Boolean</code> type. - * - * Default: true - * Group: producer - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default BeanComponentBuilder cache(java.lang.Boolean cache) { - doSetProperty("cache", cache); - return this; - } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to @@ -153,7 +137,6 @@ public interface BeanComponentBuilderFactory { String name, Object value) { switch (name) { - case "cache": ((BeanComponent) component).setCache((java.lang.Boolean) value); return true; case "lazyStartProducer": ((BeanComponent) component).setLazyStartProducer((boolean) value); return true; case "scope": ((BeanComponent) component).setScope((org.apache.camel.BeanScope) value); return true; case "autowiredEnabled": ((BeanComponent) component).setAutowiredEnabled((boolean) value); return true; 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 08daf2dc1e5..ae69bacc9d0 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 @@ -48,22 +48,6 @@ public interface ClasComponentBuilderFactory { * Builder for the Class component. */ interface ClasComponentBuilder extends ComponentBuilder<ClassComponent> { - /** - * Use singleton option instead. - * - * The option is a: <code>java.lang.Boolean</code> type. - * - * Default: true - * Group: producer - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default ClasComponentBuilder cache(java.lang.Boolean cache) { - doSetProperty("cache", cache); - return this; - } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to @@ -153,7 +137,6 @@ public interface ClasComponentBuilderFactory { String name, Object value) { switch (name) { - case "cache": ((ClassComponent) component).setCache((java.lang.Boolean) value); return true; case "lazyStartProducer": ((ClassComponent) component).setLazyStartProducer((boolean) value); return true; case "scope": ((ClassComponent) component).setScope((org.apache.camel.BeanScope) value); return true; case "autowiredEnabled": ((ClassComponent) component).setAutowiredEnabled((boolean) value); return true; 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 c5ce441b431..8f81ccfcfab 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 @@ -42,37 +42,6 @@ public interface BeanEndpointBuilderFactory { default AdvancedBeanEndpointBuilder advanced() { return (AdvancedBeanEndpointBuilder) this; } - /** - * Use scope option instead. - * - * The option is a: <code>java.lang.Boolean</code> type. - * - * Group: common - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default BeanEndpointBuilder cache(Boolean cache) { - doSetProperty("cache", cache); - return this; - } - /** - * Use scope option instead. - * - * The option will be converted to a - * <code>java.lang.Boolean</code> type. - * - * Group: common - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default BeanEndpointBuilder cache(String cache) { - doSetProperty("cache", cache); - return this; - } /** * Sets the name of the method to invoke on the bean. * 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 7ca9c4bac8d..4688e807ffd 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 @@ -42,37 +42,6 @@ public interface ClassEndpointBuilderFactory { default AdvancedClassEndpointBuilder advanced() { return (AdvancedClassEndpointBuilder) this; } - /** - * Use scope option instead. - * - * The option is a: <code>java.lang.Boolean</code> type. - * - * Group: common - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default ClassEndpointBuilder cache(Boolean cache) { - doSetProperty("cache", cache); - return this; - } - /** - * Use scope option instead. - * - * The option will be converted to a - * <code>java.lang.Boolean</code> type. - * - * Group: common - * - * @param cache the value to set - * @return the dsl builder - */ - @Deprecated - default ClassEndpointBuilder cache(String cache) { - doSetProperty("cache", cache); - return this; - } /** * Sets the name of the method to invoke on the bean. * diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java index 65319fd4461..b80cf506e17 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java @@ -163,13 +163,11 @@ public class EndpointSchemaGeneratorMojo extends AbstractGeneratorMojo { String extendsScheme = uriEndpoint.extendsScheme(); String title = uriEndpoint.title(); Category[] categories = uriEndpoint.category(); - String label; + String label = null; if (categories.length > 0) { label = Arrays.stream(categories) .map(Category::getValue) .collect(Collectors.joining(",")); - } else { - label = uriEndpoint.label(); } validateSchemaName(scheme, classElement); // support multiple schemes separated by comma, which maps to diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java index 972bd7d96d2..f4d4855147d 100644 --- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java +++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/UriEndpoint.java @@ -98,25 +98,12 @@ public @interface UriEndpoint { String consumerPrefix() default ""; /** - * A human readable title of this entity, such as the component name of the this endpoint. + * A human-readable title of this entity, such as the component name of the this endpoint. * <p/> * For example: JMS, MQTT, Netty HTTP, SAP NetWeaver */ String title(); - /** - * To associate this endpoint with label(s). - * <p/> - * Multiple labels can be defined as a comma separated value. - * <p/> - * The labels is intended for grouping the endpoints, such as <tt>core</tt>, <tt>file</tt>, <tt>messaging</tt>, - * <tt>database</tt>, etc. - * <p/> - * Deprecated: Use the category field instead - */ - @Deprecated - String label() default ""; - /** * To associate this endpoint with category(ies). * <p/> @@ -130,14 +117,14 @@ public @interface UriEndpoint { /** * Whether this endpoint can only be used as a producer. * <p/> - * By default its assumed the endpoint can be used as both consumer and producer. + * By default, its assumed the endpoint can be used as both consumer and producer. */ boolean producerOnly() default false; /** * Whether this endpoint can only be used as a consumer. * <p/> - * By default its assumed the endpoint can be used as both consumer and producer. + * By default, its assumed the endpoint can be used as both consumer and producer. */ boolean consumerOnly() default false;
