You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2019/01/14 15:28:27 UTC
[camel] branch master updated: Add annotations for cloud service
factory and send dynamic
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new ec4900c Add annotations for cloud service factory and send dynamic
ec4900c is described below
commit ec4900c9fa3f6aaed26ef38480da1d419419bf02
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Dec 18 10:34:15 2018 +0100
Add annotations for cloud service factory and send dynamic
# Conflicts:
# components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
# components/camel-jgroups/src/main/resources/META-INF/LICENSE.txt
# components/camel-jgroups/src/main/resources/META-INF/NOTICE.txt
# tooling/apt/src/main/java/org/apache/camel/tools/apt/AnnotationProcessorHelper.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/ConverterProcessor.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/DocumentationHelper.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/ModelAnnotationProcessor.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/SpringAnnotationProcessorHelper.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentModel.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/model/ComponentOption.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointOption.java
# tooling/apt/src/main/java/org/apache/camel/tools/apt/model/EndpointPath.java
# tooling/apt/src/main/resources/META-INF/services/javax.annotation.processing.Processor
# tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareComponentMojo.java
---
.../camel/component/file/FileProcessStrategy.java | 4 +-
.../impl/cloud/BlacklistServiceFilterFactory.java | 2 +
.../impl/cloud/CachingServiceDiscoveryFactory.java | 2 +
.../cloud/CombinedServiceDiscoveryFactory.java | 2 +
.../impl/cloud/CombinedServiceFilterFactory.java | 2 +
.../cloud/DefaultServiceLoadBalancerFactory.java | 2 +
.../impl/cloud/HealthyServiceFilterFactory.java | 2 +
.../cloud/PassThroughServiceFilterFactory.java | 2 +
.../impl/cloud/StaticServiceDiscoveryFactory.java | 2 +
.../apache/camel/cloud/blacklist-service-filter | 17 -----
.../apache/camel/cloud/caching-service-discovery | 17 -----
.../apache/camel/cloud/combined-service-discovery | 17 -----
.../org/apache/camel/cloud/combined-service-filter | 17 -----
.../camel/cloud/default-service-load-balancer | 17 -----
.../org/apache/camel/cloud/healthy-service-filter | 17 -----
.../apache/camel/cloud/pass-through-service-filter | 17 -----
.../apache/camel/cloud/static-service-discovery | 17 -----
.../cloud/ConsulServiceDiscoveryFactory.java | 2 +
.../apache/camel/cloud/consul-service-discovery | 17 -----
.../dns/cloud/DnsServiceDiscoveryFactory.java | 2 +
.../org/apache/camel/cloud/dns-service-discovery | 17 -----
.../etcd/cloud/EtcdServiceDiscoveryFactory.java | 2 +
.../org/apache/camel/cloud/etcd-service-discovery | 17 -----
.../component/http4/HttpSendDynamicAware.java | 16 +---
.../http4/cloud/Http4ServiceExpressionFactory.java | 2 +
.../apache/camel/cloud/http4-service-expression | 17 -----
.../apache/camel/cloud/https4-service-expression | 17 -----
.../services/org/apache/camel/send-dynamic/http4 | 18 -----
.../services/org/apache/camel/send-dynamic/https4 | 18 -----
.../jetty/cloud/JettyServiceExpressionFactory.java | 2 +
.../apache/camel/cloud/jetty-service-expression | 17 -----
.../component/jetty9/HttpSendDynamicAware.java | 16 +---
.../services/org/apache/camel/send-dynamic/jetty | 17 -----
.../apache/camel/component/scp/ScpComponent.java | 2 -
.../cloud/KubernetesServiceDiscoveryFactory.java | 2 +
.../camel/cloud/kubernetes-service-discovery | 17 -----
.../netty4/http/NettyHttpSendDynamicAware.java | 2 +
.../cloud/Netty4HttpServiceExpressionFactory.java | 2 +
.../camel/cloud/netty4-http-service-expression | 17 -----
.../org/apache/camel/send-dynamic/netty4-http | 17 -----
.../cloud/RibbonServiceLoadBalancerFactory.java | 2 +
.../camel/cloud/ribbon-service-load-balancer | 17 -----
.../component/undertow/HttpSendDynamicAware.java | 16 +---
.../cloud/UndertowServiceExpressionFactory.java | 2 +
.../apache/camel/cloud/undertow-service-expression | 17 -----
.../org/apache/camel/send-dynamic/undertow | 18 -----
.../cloud/ZooKeeperServiceDiscoveryFactory.java | 2 +
.../apache/camel/cloud/zookeeper-service-discovery | 17 -----
.../org/apache/camel/tools/apt/SpiProcessor.java | 87 ++++++----------------
.../{Factory.java => CloudServiceFactory.java} | 3 +-
.../apache/camel/spi/annotations/Component.java | 1 +
.../apache/camel/spi/annotations/Dataformat.java | 1 +
.../org/apache/camel/spi/annotations/Language.java | 1 +
.../annotations/{Factory.java => SendDynamic.java} | 3 +-
.../{Factory.java => ServiceFactory.java} | 2 +-
.../{Factory.java => SubServiceFactory.java} | 2 +-
56 files changed, 84 insertions(+), 519 deletions(-)
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/FileProcessStrategy.java b/camel-core/src/main/java/org/apache/camel/component/file/FileProcessStrategy.java
index 48a5682..377c1ab 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/FileProcessStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/FileProcessStrategy.java
@@ -6,12 +6,12 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.camel.spi.annotations.Factory;
+import org.apache.camel.spi.annotations.SubServiceFactory;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
-@Factory("strategy.factory")
+@SubServiceFactory("strategy.factory")
public @interface FileProcessStrategy {
Class value();
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/BlacklistServiceFilterFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/BlacklistServiceFilterFactory.java
index 38d213b..b0a55ef 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/BlacklistServiceFilterFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/BlacklistServiceFilterFactory.java
@@ -21,7 +21,9 @@ import java.util.List;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceFilter;
import org.apache.camel.cloud.ServiceFilterFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("blacklist-service-filter")
public class BlacklistServiceFilterFactory implements ServiceFilterFactory {
private List<String> servers;
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/CachingServiceDiscoveryFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/CachingServiceDiscoveryFactory.java
index d037a11..627a5dd 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/CachingServiceDiscoveryFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/CachingServiceDiscoveryFactory.java
@@ -21,8 +21,10 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.util.ObjectHelper;
+@CloudServiceFactory("caching-service-discovery")
public class CachingServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private Integer timeout;
private TimeUnit units;
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceDiscoveryFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceDiscoveryFactory.java
index c0b083a..b5e408d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceDiscoveryFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceDiscoveryFactory.java
@@ -21,8 +21,10 @@ import java.util.List;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.util.ObjectHelper;
+@CloudServiceFactory("combined-service-discovery")
public class CombinedServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private List<ServiceDiscovery> serviceDiscoveryList;
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceFilterFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceFilterFactory.java
index bce36d6..054899d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceFilterFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/CombinedServiceFilterFactory.java
@@ -21,8 +21,10 @@ import java.util.List;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceFilter;
import org.apache.camel.cloud.ServiceFilterFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.util.ObjectHelper;
+@CloudServiceFactory("combined-service-filter")
public class CombinedServiceFilterFactory implements ServiceFilterFactory {
private List<ServiceFilter> serviceFilterList;
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/DefaultServiceLoadBalancerFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/DefaultServiceLoadBalancerFactory.java
index bdbb7f6..6a528d0 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/DefaultServiceLoadBalancerFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/DefaultServiceLoadBalancerFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.impl.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceLoadBalancer;
import org.apache.camel.cloud.ServiceLoadBalancerFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("default-service-load-balancer")
public class DefaultServiceLoadBalancerFactory implements ServiceLoadBalancerFactory {
@Override
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/HealthyServiceFilterFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/HealthyServiceFilterFactory.java
index 31c531f..aaa0265 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/HealthyServiceFilterFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/HealthyServiceFilterFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.impl.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceFilter;
import org.apache.camel.cloud.ServiceFilterFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("healthy-service-filter")
public class HealthyServiceFilterFactory implements ServiceFilterFactory {
public HealthyServiceFilterFactory() {
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/PassThroughServiceFilterFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/PassThroughServiceFilterFactory.java
index da3c5eb..9d14c53 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/PassThroughServiceFilterFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/PassThroughServiceFilterFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.impl.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceFilter;
import org.apache.camel.cloud.ServiceFilterFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("pass-through-service-filter")
public class PassThroughServiceFilterFactory implements ServiceFilterFactory {
public PassThroughServiceFilterFactory() {
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/StaticServiceDiscoveryFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/StaticServiceDiscoveryFactory.java
index eb4d983..a3c24d70 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/StaticServiceDiscoveryFactory.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/cloud/StaticServiceDiscoveryFactory.java
@@ -21,7 +21,9 @@ import java.util.List;
import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("static-service-discovery")
public class StaticServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private List<String> servers;
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/blacklist-service-filter b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/blacklist-service-filter
deleted file mode 100644
index 29ee4e6..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/blacklist-service-filter
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.BlacklistServiceFilterFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/caching-service-discovery b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/caching-service-discovery
deleted file mode 100644
index 7a57359..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/caching-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.CachingServiceDiscoveryFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-discovery b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-discovery
deleted file mode 100644
index 67efb31..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.CombinedServiceDiscoveryFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-filter b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-filter
deleted file mode 100644
index 68cdfc2..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/combined-service-filter
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.CombinedServiceFilterFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/default-service-load-balancer b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/default-service-load-balancer
deleted file mode 100644
index 16644c8..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/default-service-load-balancer
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.DefaultServiceLoadBalancerFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/healthy-service-filter b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/healthy-service-filter
deleted file mode 100644
index b1cdd65..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/healthy-service-filter
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.HealthyServiceFilterFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/pass-through-service-filter b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/pass-through-service-filter
deleted file mode 100644
index e1e1912..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/pass-through-service-filter
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.PassThroughServiceFilterFactory
\ No newline at end of file
diff --git a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery b/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery
deleted file mode 100644
index 5d2f763..0000000
--- a/camel-core/src/main/resources/META-INF/services/org/apache/camel/cloud/static-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.impl.cloud.StaticServiceDiscoveryFactory
\ No newline at end of file
diff --git a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryFactory.java b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryFactory.java
index 81a46ef..3fba1f6 100644
--- a/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryFactory.java
+++ b/components/camel-consul/src/main/java/org/apache/camel/component/consul/cloud/ConsulServiceDiscoveryFactory.java
@@ -20,8 +20,10 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
import org.apache.camel.component.consul.ConsulConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.support.jsse.SSLContextParameters;
+@CloudServiceFactory("consul-service-discovery")
public class ConsulServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private final ConsulConfiguration configuration;
diff --git a/components/camel-consul/src/main/resources/META-INF/services/org/apache/camel/cloud/consul-service-discovery b/components/camel-consul/src/main/resources/META-INF/services/org/apache/camel/cloud/consul-service-discovery
deleted file mode 100644
index b8019a2..0000000
--- a/components/camel-consul/src/main/resources/META-INF/services/org/apache/camel/cloud/consul-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.consul.cloud.ConsulServiceDiscoveryFactory
diff --git a/components/camel-dns/src/main/java/org/apache/camel/component/dns/cloud/DnsServiceDiscoveryFactory.java b/components/camel-dns/src/main/java/org/apache/camel/component/dns/cloud/DnsServiceDiscoveryFactory.java
index 5c70532..aa7c182 100644
--- a/components/camel-dns/src/main/java/org/apache/camel/component/dns/cloud/DnsServiceDiscoveryFactory.java
+++ b/components/camel-dns/src/main/java/org/apache/camel/component/dns/cloud/DnsServiceDiscoveryFactory.java
@@ -20,7 +20,9 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
import org.apache.camel.component.dns.DnsConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("dns-service-discovery")
public class DnsServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private final DnsConfiguration configuration;
diff --git a/components/camel-dns/src/main/resources/META-INF/services/org/apache/camel/cloud/dns-service-discovery b/components/camel-dns/src/main/resources/META-INF/services/org/apache/camel/cloud/dns-service-discovery
deleted file mode 100644
index 4c667da..0000000
--- a/components/camel-dns/src/main/resources/META-INF/services/org/apache/camel/cloud/dns-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.dns.cloud.DnsServiceDiscoveryFactory
diff --git a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/cloud/EtcdServiceDiscoveryFactory.java b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/cloud/EtcdServiceDiscoveryFactory.java
index 2a0516e..770d4ad 100644
--- a/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/cloud/EtcdServiceDiscoveryFactory.java
+++ b/components/camel-etcd/src/main/java/org/apache/camel/component/etcd/cloud/EtcdServiceDiscoveryFactory.java
@@ -20,9 +20,11 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
import org.apache.camel.component.etcd.EtcdConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.support.jsse.SSLContextParameters;
+@CloudServiceFactory("etcd-service-discovery")
public class EtcdServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private final EtcdConfiguration configuration;
private String type;
diff --git a/components/camel-etcd/src/main/resources/META-INF/services/org/apache/camel/cloud/etcd-service-discovery b/components/camel-etcd/src/main/resources/META-INF/services/org/apache/camel/cloud/etcd-service-discovery
deleted file mode 100644
index 4d4505f..0000000
--- a/components/camel-etcd/src/main/resources/META-INF/services/org/apache/camel/cloud/etcd-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.etcd.cloud.EtcdServiceDiscoveryFactory
\ No newline at end of file
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpSendDynamicAware.java
similarity index 68%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpSendDynamicAware.java
index e8127e3..bba79fe 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpSendDynamicAware.java
@@ -14,19 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.spi.annotations;
+package org.apache.camel.component.http4;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import org.apache.camel.spi.annotations.SendDynamic;
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Target({ElementType.TYPE })
-public @interface Factory {
-
- String value();
+@SendDynamic("http4,https4")
+public class HttpSendDynamicAware extends org.apache.camel.http.common.HttpSendDynamicAware {
}
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/cloud/Http4ServiceExpressionFactory.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/cloud/Http4ServiceExpressionFactory.java
index 346242b..32e982a 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/cloud/Http4ServiceExpressionFactory.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/cloud/Http4ServiceExpressionFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.component.http4.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.Expression;
import org.apache.camel.cloud.ServiceExpressionFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("http4-service-expression,https4-service-expression")
public class Http4ServiceExpressionFactory implements ServiceExpressionFactory {
@Override
public Expression newInstance(CamelContext camelContext) throws Exception {
diff --git a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/http4-service-expression b/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/http4-service-expression
deleted file mode 100644
index 60bc936..0000000
--- a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/http4-service-expression
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.http4.cloud.Http4ServiceExpressionFactory
\ No newline at end of file
diff --git a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/https4-service-expression b/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/https4-service-expression
deleted file mode 100644
index 60bc936..0000000
--- a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/cloud/https4-service-expression
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.http4.cloud.Http4ServiceExpressionFactory
\ No newline at end of file
diff --git a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/http4 b/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/http4
deleted file mode 100644
index 9b46865..0000000
--- a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/http4
+++ /dev/null
@@ -1,18 +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.
-#
-
-class=org.apache.camel.http.common.HttpSendDynamicAware
diff --git a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/https4 b/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/https4
deleted file mode 100644
index 9b46865..0000000
--- a/components/camel-http4/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/https4
+++ /dev/null
@@ -1,18 +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.
-#
-
-class=org.apache.camel.http.common.HttpSendDynamicAware
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/cloud/JettyServiceExpressionFactory.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/cloud/JettyServiceExpressionFactory.java
index ffe8df4..b846320 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/cloud/JettyServiceExpressionFactory.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/cloud/JettyServiceExpressionFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.component.jetty.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.Expression;
import org.apache.camel.cloud.ServiceExpressionFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("jetty-service-expression")
public class JettyServiceExpressionFactory implements ServiceExpressionFactory {
@Override
public Expression newInstance(CamelContext camelContext) throws Exception {
diff --git a/components/camel-jetty-common/src/main/resources/META-INF/services/org/apache/camel/cloud/jetty-service-expression b/components/camel-jetty-common/src/main/resources/META-INF/services/org/apache/camel/cloud/jetty-service-expression
deleted file mode 100644
index 8932495..0000000
--- a/components/camel-jetty-common/src/main/resources/META-INF/services/org/apache/camel/cloud/jetty-service-expression
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.jetty.cloud.JettyServiceExpressionFactory
\ No newline at end of file
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
similarity index 68%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
index e8127e3..7ecc9b4 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
@@ -14,19 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.spi.annotations;
+package org.apache.camel.component.jetty9;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import org.apache.camel.spi.annotations.SendDynamic;
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Target({ElementType.TYPE })
-public @interface Factory {
-
- String value();
+@SendDynamic("jetty")
+public class HttpSendDynamicAware extends org.apache.camel.http.common.HttpSendDynamicAware {
}
diff --git a/components/camel-jetty9/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/jetty b/components/camel-jetty9/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/jetty
deleted file mode 100644
index d65016e..0000000
--- a/components/camel-jetty9/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/jetty
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.http.common.HttpSendDynamicAware
diff --git a/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java b/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java
index 7068b39..e0202b7 100644
--- a/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java
+++ b/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java
@@ -24,9 +24,7 @@ import org.apache.camel.CamelContext;
import org.apache.camel.component.file.FileProcessStrategy;
import org.apache.camel.component.file.GenericFileEndpoint;
import org.apache.camel.component.file.remote.RemoteFileComponent;
-import org.apache.camel.component.file.strategy.FileProcessStrategyFactory;
import org.apache.camel.spi.annotations.Component;
-import org.apache.camel.spi.annotations.Factory;
/**
* Component providing secure messaging using JSch
diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cloud/KubernetesServiceDiscoveryFactory.java b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cloud/KubernetesServiceDiscoveryFactory.java
index 2b24ae2..e65ba41 100644
--- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cloud/KubernetesServiceDiscoveryFactory.java
+++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cloud/KubernetesServiceDiscoveryFactory.java
@@ -20,8 +20,10 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
import org.apache.camel.component.kubernetes.KubernetesConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.camel.util.ObjectHelper;
+@CloudServiceFactory("kubernetes-service-discovery")
public class KubernetesServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private final KubernetesConfiguration configuration;
private String lookup;
diff --git a/components/camel-kubernetes/src/main/resources/META-INF/services/org/apache/camel/cloud/kubernetes-service-discovery b/components/camel-kubernetes/src/main/resources/META-INF/services/org/apache/camel/cloud/kubernetes-service-discovery
deleted file mode 100644
index db3d36a..0000000
--- a/components/camel-kubernetes/src/main/resources/META-INF/services/org/apache/camel/cloud/kubernetes-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.kubernetes.cloud.KubernetesServiceDiscoveryFactory
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpSendDynamicAware.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpSendDynamicAware.java
index 96d86a7..73e8df5 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpSendDynamicAware.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpSendDynamicAware.java
@@ -17,7 +17,9 @@
package org.apache.camel.component.netty4.http;
import org.apache.camel.http.common.HttpSendDynamicAware;
+import org.apache.camel.spi.annotations.SendDynamic;
+@SendDynamic("netty4-http")
public class NettyHttpSendDynamicAware extends HttpSendDynamicAware {
@Override
diff --git a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/cloud/Netty4HttpServiceExpressionFactory.java b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/cloud/Netty4HttpServiceExpressionFactory.java
index 94cfc94..591615e 100644
--- a/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/cloud/Netty4HttpServiceExpressionFactory.java
+++ b/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/cloud/Netty4HttpServiceExpressionFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.component.netty4.http.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.Expression;
import org.apache.camel.cloud.ServiceExpressionFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("netty4-http-service-expression")
public class Netty4HttpServiceExpressionFactory implements ServiceExpressionFactory {
@Override
public Expression newInstance(CamelContext camelContext) throws Exception {
diff --git a/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/cloud/netty4-http-service-expression b/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/cloud/netty4-http-service-expression
deleted file mode 100644
index 976e275..0000000
--- a/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/cloud/netty4-http-service-expression
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.netty4.http.cloud.Netty4ServiceExpressionFactory
\ No newline at end of file
diff --git a/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/netty4-http b/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/netty4-http
deleted file mode 100644
index e9d3f2e..0000000
--- a/components/camel-netty4-http/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/netty4-http
+++ /dev/null
@@ -1,17 +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.
-#
-
-class=org.apache.camel.component.netty4.http.NettyHttpSendDynamicAware
diff --git a/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancerFactory.java b/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancerFactory.java
index 0e328bf..5cfa13b 100644
--- a/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancerFactory.java
+++ b/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/cloud/RibbonServiceLoadBalancerFactory.java
@@ -22,7 +22,9 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceLoadBalancer;
import org.apache.camel.cloud.ServiceLoadBalancerFactory;
import org.apache.camel.component.ribbon.RibbonConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("ribbon-service-load-balancer")
public class RibbonServiceLoadBalancerFactory implements ServiceLoadBalancerFactory {
private final RibbonConfiguration configuration;
diff --git a/components/camel-ribbon/src/main/resources/META-INF/services/org/apache/camel/cloud/ribbon-service-load-balancer b/components/camel-ribbon/src/main/resources/META-INF/services/org/apache/camel/cloud/ribbon-service-load-balancer
deleted file mode 100644
index 65c38dd..0000000
--- a/components/camel-ribbon/src/main/resources/META-INF/services/org/apache/camel/cloud/ribbon-service-load-balancer
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.ribbon.cloud.RibbonServiceLoadBalancerFactory
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/HttpSendDynamicAware.java
similarity index 68%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to components/camel-undertow/src/main/java/org/apache/camel/component/undertow/HttpSendDynamicAware.java
index e8127e3..368815f 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/HttpSendDynamicAware.java
@@ -14,19 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.spi.annotations;
+package org.apache.camel.component.undertow;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import org.apache.camel.spi.annotations.SendDynamic;
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Target({ElementType.TYPE })
-public @interface Factory {
-
- String value();
+@SendDynamic("undertow")
+public class HttpSendDynamicAware extends org.apache.camel.http.common.HttpSendDynamicAware {
}
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/cloud/UndertowServiceExpressionFactory.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/cloud/UndertowServiceExpressionFactory.java
index b42f5b2..764a369 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/cloud/UndertowServiceExpressionFactory.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/cloud/UndertowServiceExpressionFactory.java
@@ -19,7 +19,9 @@ package org.apache.camel.component.undertow.cloud;
import org.apache.camel.CamelContext;
import org.apache.camel.Expression;
import org.apache.camel.cloud.ServiceExpressionFactory;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
+@CloudServiceFactory("undertow-service-expression")
public class UndertowServiceExpressionFactory implements ServiceExpressionFactory {
@Override
public Expression newInstance(CamelContext camelContext) throws Exception {
diff --git a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/cloud/undertow-service-expression b/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/cloud/undertow-service-expression
deleted file mode 100644
index 2b8f247..0000000
--- a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/cloud/undertow-service-expression
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.undertow.cloud.UndertowServiceExpressionFactory
\ No newline at end of file
diff --git a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/undertow b/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/undertow
deleted file mode 100644
index 9b46865..0000000
--- a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/send-dynamic/undertow
+++ /dev/null
@@ -1,18 +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.
-#
-
-class=org.apache.camel.http.common.HttpSendDynamicAware
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactory.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactory.java
index 25c29f9..887c263 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactory.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceDiscoveryFactory.java
@@ -23,10 +23,12 @@ import org.apache.camel.CamelContext;
import org.apache.camel.cloud.ServiceDiscovery;
import org.apache.camel.cloud.ServiceDiscoveryFactory;
import org.apache.camel.component.zookeeper.ZooKeeperCuratorConfiguration;
+import org.apache.camel.spi.annotations.CloudServiceFactory;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.AuthInfo;
import org.apache.curator.framework.CuratorFramework;
+@CloudServiceFactory("zookeeper-service-discovery")
public class ZooKeeperServiceDiscoveryFactory implements ServiceDiscoveryFactory {
private ZooKeeperCuratorConfiguration configuration;
diff --git a/components/camel-zookeeper/src/main/resources/META-INF/services/org/apache/camel/cloud/zookeeper-service-discovery b/components/camel-zookeeper/src/main/resources/META-INF/services/org/apache/camel/cloud/zookeeper-service-discovery
deleted file mode 100644
index 6d8290de..0000000
--- a/components/camel-zookeeper/src/main/resources/META-INF/services/org/apache/camel/cloud/zookeeper-service-discovery
+++ /dev/null
@@ -1,17 +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.
-#
-class=org.apache.camel.component.zookeeper.cloud.ZooKeeperServiceDiscoveryFactory
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpiProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpiProcessor.java
index 3f01a8b..752219d 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpiProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/SpiProcessor.java
@@ -23,15 +23,12 @@ import java.util.Set;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.AnnotationMirror;
-import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.FileObject;
import javax.tools.StandardLocation;
-import org.apache.camel.spi.annotations.Component;
-import org.apache.camel.spi.annotations.Dataformat;
-import org.apache.camel.spi.annotations.Factory;
-import org.apache.camel.spi.annotations.Language;
+import org.apache.camel.spi.annotations.ServiceFactory;
+import org.apache.camel.spi.annotations.SubServiceFactory;
import static org.apache.camel.tools.apt.helper.Strings.canonicalClassName;
@@ -40,37 +37,33 @@ public class SpiProcessor extends AbstractCamelAnnotationProcessor {
@Override
protected void doProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws Exception {
- Set<? extends Element> factories = roundEnv.getElementsAnnotatedWith(Factory.class);
- roundEnv.getElementsAnnotatedWith(Component.class).stream()
+ roundEnv.getRootElements().stream()
.filter(e -> e instanceof TypeElement)
.map(TypeElement.class::cast)
- .forEach(e -> processComponent(e, factories));
- roundEnv.getElementsAnnotatedWith(Language.class).stream()
- .filter(e -> e instanceof TypeElement)
- .map(TypeElement.class::cast)
- .forEach(this::processLanguage);
- roundEnv.getElementsAnnotatedWith(Dataformat.class).stream()
- .filter(e -> e instanceof TypeElement)
- .map(TypeElement.class::cast)
- .forEach(this::processDataformat);
+ .forEach(this::processServiceFactory);
}
- private void processComponent(TypeElement element, Set<? extends Element> factories) {
+ private void processServiceFactory(TypeElement element) {
try {
final String javaTypeName = canonicalClassName(element.getQualifiedName().toString());
- String[] schemes = element.getAnnotation(Component.class).value().split(",");
- for (String scheme : schemes) {
- FileObject resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
- "", "META-INF/services/org/apache/camel/component/" + scheme, element);
- try (Writer w = resource.openWriter()) {
- w.append("# Generated by camel annotation processor\n");
- w.append("class=").append(javaTypeName).append("\n");
- for (AnnotationMirror am : element.getAnnotationMirrors()) {
- Factory factory = am.getAnnotationType().asElement().getAnnotation(Factory.class);
- if (factory != null) {
- String key = factory.value();
- String val = am.getElementValues().values().iterator().next().getValue().toString();
- w.append(key).append(".class=").append(val).append("\n");
+ for (AnnotationMirror pam : element.getAnnotationMirrors()) {
+ ServiceFactory sf = pam.getAnnotationType().asElement().getAnnotation(ServiceFactory.class);
+ if (sf != null) {
+ String pvals = pam.getElementValues().values().iterator().next().getValue().toString();
+ for (String pval : pvals.split(",")) {
+ FileObject resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
+ "", "META-INF/services/org/apache/camel/" + sf.value() + "/" + pval, element);
+ try (Writer w = resource.openWriter()) {
+ w.append("# Generated by camel annotation processor\n");
+ w.append("class=").append(javaTypeName).append("\n");
+ for (AnnotationMirror am : element.getAnnotationMirrors()) {
+ SubServiceFactory factory = am.getAnnotationType().asElement().getAnnotation(SubServiceFactory.class);
+ if (factory != null) {
+ String key = factory.value();
+ String val = am.getElementValues().values().iterator().next().getValue().toString();
+ w.append(key).append(".class=").append(val).append("\n");
+ }
+ }
}
}
}
@@ -80,38 +73,4 @@ public class SpiProcessor extends AbstractCamelAnnotationProcessor {
}
}
- private void processLanguage(TypeElement element) {
- try {
- final String javaTypeName = canonicalClassName(element.getQualifiedName().toString());
- String[] schemes = element.getAnnotation(Language.class).value().split(",");
- for (String scheme : schemes) {
- FileObject resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
- "", "META-INF/services/org/apache/camel/language/" + scheme, element);
- try (Writer w = resource.openWriter()) {
- w.append("# Generated by camel annotation processor\n");
- w.append("class=").append(javaTypeName).append("\n");
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void processDataformat(TypeElement element) {
- try {
- final String javaTypeName = canonicalClassName(element.getQualifiedName().toString());
- String[] schemes = element.getAnnotation(Dataformat.class).value().split(",");
- for (String scheme : schemes) {
- FileObject resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
- "", "META-INF/services/org/apache/camel/dataformat/" + scheme, element);
- try (Writer w = resource.openWriter()) {
- w.append("# Generated by camel annotation processor\n");
- w.append("class=").append(javaTypeName).append("\n");
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
}
\ No newline at end of file
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/CloudServiceFactory.java
similarity index 94%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/CloudServiceFactory.java
index e8127e3..cc96c2d 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/CloudServiceFactory.java
@@ -25,7 +25,8 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
-public @interface Factory {
+@ServiceFactory("cloud")
+public @interface CloudServiceFactory {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Component.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Component.java
index dc44a82..9578e07 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Component.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Component.java
@@ -25,6 +25,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
+@ServiceFactory("component")
public @interface Component {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Dataformat.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Dataformat.java
index 2f36c97..dbe990f 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Dataformat.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Dataformat.java
@@ -25,6 +25,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
+@ServiceFactory("dataformat")
public @interface Dataformat {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Language.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Language.java
index 1a6c9b2..6e3a881 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Language.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Language.java
@@ -25,6 +25,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
+@ServiceFactory("language")
public @interface Language {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SendDynamic.java
similarity index 94%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SendDynamic.java
index e8127e3..a80bf1e 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SendDynamic.java
@@ -25,7 +25,8 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
-public @interface Factory {
+@ServiceFactory("send-dynamic")
+public @interface SendDynamic {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/ServiceFactory.java
similarity index 97%
copy from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
copy to tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/ServiceFactory.java
index e8127e3..09171dc 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/ServiceFactory.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
-public @interface Factory {
+public @interface ServiceFactory {
String value();
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SubServiceFactory.java
similarity index 96%
rename from tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
rename to tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SubServiceFactory.java
index e8127e3..f7fcf58 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/Factory.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/SubServiceFactory.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target({ElementType.TYPE })
-public @interface Factory {
+public @interface SubServiceFactory {
String value();