camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] branch master updated: CAMEL-12435: camel-netty4 - Shared connection pool should re-create connection if its no longer valid
Date Thu, 12 Apr 2018 11:48:23 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus 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 e6304d1  CAMEL-12435: camel-netty4 - Shared connection pool should re-create connection
if its no longer valid
e6304d1 is described below

commit e6304d148b64e0e9a352243483b1ff72f690f6be
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Thu Apr 12 13:46:15 2018 +0200

    CAMEL-12435: camel-netty4 - Shared connection pool should re-create connection if its
no longer valid
---
 .../apache/camel/component/netty4/SharedSingletonObjectPool.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/SharedSingletonObjectPool.java
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/SharedSingletonObjectPool.java
index 9121838..b7408bb 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/SharedSingletonObjectPool.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/SharedSingletonObjectPool.java
@@ -38,6 +38,13 @@ public class SharedSingletonObjectPool<T> implements ObjectPool<T>
{
 
     @Override
     public synchronized T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
{
+        if (t != null) {
+            // ensure the object is validate before we borrow it
+            if (!factory.validateObject(t)) {
+                invalidateObject(t);
+                t = null;
+            }
+        }
         if (t == null) {
             t = factory.makeObject();
         }

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

Mime
View raw message