camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-9783: Allow ConnectionConfiguration to be be injected to endpoint during connection creation. Thanks to Allan Cheong Tyng Huei for the patch.
Date Mon, 11 Apr 2016 06:04:08 GMT
Repository: camel
Updated Branches:
  refs/heads/master 0927ec50d -> 7a8771311


CAMEL-9783: Allow ConnectionConfiguration to be be injected to endpoint during connection
creation. Thanks to Allan Cheong Tyng Huei for the patch.


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

Branch: refs/heads/master
Commit: 7a8771311d8552d05edb692fa86d101cf37e9697
Parents: 0927ec5
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Apr 11 08:03:10 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Apr 11 08:03:59 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/component/xmpp/XmppEndpoint.java  | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7a877131/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
index d0609b5..6ded5b3 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
@@ -89,6 +89,8 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
     private int connectionPollDelay = 10;
     @UriParam
     private HeaderFilterStrategy headerFilterStrategy = new DefaultHeaderFilterStrategy();
+    @UriParam
+    private ConnectionConfiguration connectionConfig;
 
     public XmppEndpoint() {
     }
@@ -206,6 +208,10 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
     }
 
     private XMPPTCPConnection createConnectionInternal() {
+        if (connectionConfig != null) {
+            return new XMPPTCPConnection(connectionConfig);
+        }
+
         if (port == 0) {
             port = 5222;
         }
@@ -404,6 +410,17 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
         this.headerFilterStrategy = headerFilterStrategy;
     }
 
+    public ConnectionConfiguration getConnectionConfig() {
+        return connectionConfig;
+    }
+
+    /**
+     * To use an existing connection configuration
+     */
+    public void setConnectionConfig(ConnectionConfiguration connectionConfig) {
+        this.connectionConfig = connectionConfig;
+    }
+
     public boolean isTestConnectionOnStartup() {
         return testConnectionOnStartup;
     }


Mime
View raw message