camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-7999: More components include documentation
Date Tue, 02 Dec 2014 08:57:59 GMT
Repository: camel
Updated Branches:
  refs/heads/master a9ef2ad05 -> 28586940f


CAMEL-7999: More components include documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eab6ebb8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eab6ebb8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eab6ebb8

Branch: refs/heads/master
Commit: eab6ebb8f4646c6c445ce49929f8c6b80dfe381c
Parents: a9ef2ad
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 2 09:48:51 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 2 09:48:51 2014 +0100

----------------------------------------------------------------------
 .../camel/component/apns/ApnsComponent.java     | 18 +++++------------
 .../camel/component/apns/ApnsEndpoint.java      | 21 +++++++++++++++-----
 .../bean/validator/BeanValidatorEndpoint.java   |  2 +-
 3 files changed, 22 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eab6ebb8/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsComponent.java
b/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsComponent.java
index bc44fb1..5e70eac 100644
--- a/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsComponent.java
+++ b/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsComponent.java
@@ -19,33 +19,25 @@ package org.apache.camel.component.apns;
 import java.util.Map;
 
 import com.notnoop.apns.ApnsService;
-import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.impl.UriEndpointComponent;
 
-/**
- * Represents the component that manages {@link ApnsEndpoint}. It holds the list
- * of named apns endpoints.
- */
-public class ApnsComponent extends DefaultComponent {
+public class ApnsComponent extends UriEndpointComponent {
 
     private ApnsService apnsService;
 
     public ApnsComponent() {
+        super(ApnsEndpoint.class);
     }
 
     public ApnsComponent(ApnsService apnsService) {
-        ObjectHelper.notNull(apnsService, "apnsService");
+        this();
         this.apnsService = apnsService;
     }
 
-    public ApnsComponent(CamelContext context) {
-        super(context);
-    }
-
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
         ApnsEndpoint endpoint = new ApnsEndpoint(uri, this);
+        endpoint.setName(remaining);
         setProperties(endpoint, parameters);
         return endpoint;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/eab6ebb8/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsEndpoint.java
b/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsEndpoint.java
index 6c2c6dc..607b1dc 100644
--- a/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsEndpoint.java
+++ b/components/camel-apns/src/main/java/org/apache/camel/component/apns/ApnsEndpoint.java
@@ -20,26 +20,37 @@ import java.util.Set;
 import java.util.concurrent.CopyOnWriteArraySet;
 
 import com.notnoop.apns.ApnsService;
-
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultConsumer;
 import org.apache.camel.impl.ScheduledPollEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 
-/**
- * Represents a direct endpoint that synchronously invokes the consumers of the
- * endpoint when a producer sends a message to it.
- */
+@UriEndpoint(scheme = "apns", consumerClass = ApnsConsumer.class, label = "eventbus,mobile")
 public class ApnsEndpoint extends ScheduledPollEndpoint {
 
     private final CopyOnWriteArraySet<DefaultConsumer> consumers = new CopyOnWriteArraySet<DefaultConsumer>();
+
+    @UriPath(description = "Name of the endpoint.")
+    private String name;
+    @UriParam
     private String tokens;
 
     public ApnsEndpoint(String uri, ApnsComponent component) {
         super(uri, component);
     }
 
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
     public String getTokens() {
         return tokens;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/eab6ebb8/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
index 6583638..e4b4249 100644
--- a/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
+++ b/components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java
@@ -68,7 +68,7 @@ public class BeanValidatorEndpoint extends DefaultEndpoint {
 
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
-        throw new UnsupportedOperationException();
+        throw new UnsupportedOperationException("Consumer is not supported");
     }
 
     @Override


Mime
View raw message