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-8927: Do not swallow exception when connecting, which causes NPE exceptions later.
Date Thu, 02 Jul 2015 09:44:17 GMT
CAMEL-8927: Do not swallow exception when connecting, which causes NPE exceptions later.


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

Branch: refs/heads/camel-2.15.x
Commit: 9451290d15cfbfc75de5a5a32caf99cccc1e03f6
Parents: a9d891a
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 2 11:49:17 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 2 11:50:12 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/ahc/ws/WsEndpoint.java  | 9 +++------
 .../java/org/apache/camel/component/ahc/ws/WsProducer.java  | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9451290d/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
index 9a714fa..4a60d02 100644
--- a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
+++ b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
@@ -80,14 +80,10 @@ public class WsEndpoint extends AhcEndpoint {
         return new WsConsumer(this, processor);
     }
 
-    WebSocket getWebSocket() {
+    WebSocket getWebSocket() throws Exception {
         synchronized (this) {
             if (websocket == null) {
-                try { 
-                    connect();
-                } catch (Exception e) {
-                    LOG.error("Failed to connect", e);
-                }
+                connect();
             }
         }
         return websocket;
@@ -133,6 +129,7 @@ public class WsEndpoint extends AhcEndpoint {
     protected void doStop() throws Exception {
         if (websocket != null && websocket.isOpen()) {
             websocket.close();
+            websocket = null;
         }
         super.doStop();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/9451290d/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsProducer.java
b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsProducer.java
index 47a3939..d6319ad 100644
--- a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsProducer.java
+++ b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsProducer.java
@@ -132,7 +132,7 @@ public class WsProducer extends DefaultProducer {
         }
     }
     
-    private WebSocket getWebSocket() {
+    private WebSocket getWebSocket() throws Exception {
         return getEndpoint().getWebSocket();
     }
 }


Mime
View raw message