camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-7999: More components include documentation
Date Mon, 05 Jan 2015 15:34:02 GMT
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/2dc76a50
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2dc76a50
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2dc76a50

Branch: refs/heads/master
Commit: 2dc76a50a49bc43f264d2d6ba0e838811d0ad95e
Parents: b46e7c2
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Jan 5 16:24:20 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jan 5 16:33:47 2015 +0100

----------------------------------------------------------------------
 .../component/rabbitmq/RabbitMQComponent.java   |  9 ++--
 .../component/rabbitmq/RabbitMQEndpoint.java    | 54 +++++++++++++++++---
 2 files changed, 50 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2dc76a50/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
index 7c76d6d..5f97f49 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
@@ -18,25 +18,24 @@ package org.apache.camel.component.rabbitmq;
 
 import java.net.URI;
 import java.util.Map;
-
 import javax.net.ssl.TrustManager;
 
 import com.rabbitmq.client.ConnectionFactory;
-
 import org.apache.camel.CamelContext;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.impl.UriEndpointComponent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class RabbitMQComponent extends DefaultComponent {
+public class RabbitMQComponent extends UriEndpointComponent {
 
     private static final Logger LOG = LoggerFactory.getLogger(RabbitMQComponent.class);
 
     public RabbitMQComponent() {
+        super(RabbitMQEndpoint.class);
     }
 
     public RabbitMQComponent(CamelContext context) {
-        super(context);
+        super(context, RabbitMQEndpoint.class);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/2dc76a50/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java
index f36fd82..c69d952 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java
@@ -25,7 +25,6 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-
 import javax.net.ssl.TrustManager;
 
 import com.rabbitmq.client.AMQP;
@@ -35,7 +34,6 @@ import com.rabbitmq.client.Connection;
 import com.rabbitmq.client.ConnectionFactory;
 import com.rabbitmq.client.Envelope;
 import com.rabbitmq.client.LongString;
-
 import org.apache.camel.Consumer;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
@@ -44,60 +42,100 @@ import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.impl.DefaultMessage;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 
+@UriEndpoint(scheme = "rabbitmq", consumerClass = RabbitMQConsumer.class, label = "messaging")
 public class RabbitMQEndpoint extends DefaultEndpoint {
 
+    @UriPath
+    private String hostname;
+    @UriPath
+    private int portNumber;
+    @UriPath
+    private String exchangeName;
+    @UriParam(defaultValue = ConnectionFactory.DEFAULT_USER)
     private String username = ConnectionFactory.DEFAULT_USER;
+    @UriParam(defaultValue = ConnectionFactory.DEFAULT_PASS)
     private String password = ConnectionFactory.DEFAULT_PASS;
+    @UriParam(defaultValue = ConnectionFactory.DEFAULT_VHOST)
     private String vhost = ConnectionFactory.DEFAULT_VHOST;
-    private String hostname;
+    @UriParam(defaultValue = "10")
     private int threadPoolSize = 10;
-    private int portNumber;
+    @UriParam(defaultValue = "true")
     private boolean autoAck = true;
+    @UriParam(defaultValue = "true")
     private boolean autoDelete = true;
+    @UriParam(defaultValue = "true")
     private boolean durable = true;
+    @UriParam(defaultValue = "false")
     private boolean bridgeEndpoint;
     private String queue = String.valueOf(UUID.randomUUID().toString().hashCode());
-    private String exchangeName;
+    @UriParam(defaultValue = "direct")
     private String exchangeType = "direct";
+    @UriParam
     private String routingKey;
+    @UriParam
     private Address[] addresses;
+    @UriParam(defaultValue = "" + ConnectionFactory.DEFAULT_CONNECTION_TIMEOUT)
     private int connectionTimeout = ConnectionFactory.DEFAULT_CONNECTION_TIMEOUT;
+    @UriParam(defaultValue = "" + ConnectionFactory.DEFAULT_CHANNEL_MAX)
     private int requestedChannelMax = ConnectionFactory.DEFAULT_CHANNEL_MAX;
+    @UriParam(defaultValue = "" + ConnectionFactory.DEFAULT_FRAME_MAX)
     private int requestedFrameMax = ConnectionFactory.DEFAULT_FRAME_MAX;
+    @UriParam(defaultValue = "" + ConnectionFactory.DEFAULT_HEARTBEAT)
     private int requestedHeartbeat = ConnectionFactory.DEFAULT_HEARTBEAT;
+    @UriParam
     private String sslProtocol;
+    @UriParam
     private TrustManager trustManager;
+    @UriParam
     private Map<String, Object> clientProperties;
+    @UriParam
     private ConnectionFactory connectionFactory;
+    @UriParam(defaultValue = "false")
     private Boolean automaticRecoveryEnabled;
+    @UriParam
     private Integer networkRecoveryInterval;
+    @UriParam(defaultValue = "false")
     private Boolean topologyRecoveryEnabled;
     //If it is true, prefetchSize, prefetchCount, prefetchGlobal will be used for basicOqs
before starting RabbitMQConsumer
+    @UriParam(defaultValue = "false")
     private boolean prefetchEnabled;
     //Default in RabbitMq is 0.
+    @UriParam
     private int prefetchSize;
+    @UriParam
     private int prefetchCount;
     //Default value in RabbitMQ is false.
+    @UriParam(defaultValue = "false")
     private boolean prefetchGlobal;
     /**
      * Number of concurrent consumer threads
      */
+    @UriParam(defaultValue = "1")
     private int concurrentConsumers = 1;
-    
     //Declares a queue and exchange in RabbitMQ, then binds both.
-    private boolean declare = true;    
+    @UriParam(defaultValue = "true")
+    private boolean declare = true;
     //Declare dead letter exchange.
+    @UriParam
     private String deadLetterExchange;
-    //Declare dead letter routhing key.
+    //Declare dead letter routing key.
+    @UriParam
     private String deadLetterRoutingKey;
     //Declare dead letter queue to declare.
+    @UriParam
     private String deadLetterQueue;
     //Dead letter exchange type.
+    @UriParam(defaultValue = "direct")
     private String deadLetterExchangeType = "direct";
     //Maximum number of opened channel in pool
+    @UriParam(defaultValue = "10")
     private int channelPoolMaxSize = 10;
     //Maximum time (in milliseconds) waiting for channel
+    @UriParam(defaultValue = "1000")
     private long channelPoolMaxWait = 1000;
 
     public RabbitMQEndpoint() {


Mime
View raw message