camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject git commit: CAMEL-6365: Better reuse the IOHelper utility to close the Spring contexts.
Date Fri, 07 Feb 2014 08:47:55 GMT
Updated Branches:
  refs/heads/master acee7685d -> 0dfba40b9


CAMEL-6365: Better reuse the IOHelper utility to close the Spring contexts.

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

Branch: refs/heads/master
Commit: 0dfba40b9c7e2312f14230ec814f76f1a960fdb9
Parents: acee768
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Fri Feb 7 09:47:37 2014 +0100
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Fri Feb 7 09:47:37 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/example/client/CamelClient.java    | 3 ++-
 .../org/apache/camel/example/client/CamelFileClient.java     | 3 ++-
 .../camel/example/spring/javaconfig/IntegrationTest.java     | 3 ++-
 .../java/org/apache/camel/example/client/CamelClient.java    | 3 ++-
 .../org/apache/camel/example/client/CamelClientEndpoint.java | 3 ++-
 .../org/apache/camel/example/client/CamelClientRemoting.java | 3 ++-
 .../camel/itest/customerrelations/CustomerServicesTest.java  | 8 ++------
 .../customerrelations/CustomerServicesWsAddressingTest.java  | 8 ++------
 8 files changed, 16 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelClient.java
b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelClient.java
index 678f83c..c2c41d1 100644
--- a/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelClient.java
+++ b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelClient.java
@@ -22,6 +22,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.util.IOHelper;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -73,7 +74,7 @@ public final class CamelClient {
         executors.shutdownNow();
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelFileClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelFileClient.java
b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelFileClient.java
index 3bfb951..a940e6d 100644
--- a/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelFileClient.java
+++ b/examples/camel-example-route-throttling/src/main/java/org/apache/camel/example/client/CamelFileClient.java
@@ -18,6 +18,7 @@ package org.apache.camel.example.client;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.util.IOHelper;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -48,7 +49,7 @@ public final class CamelFileClient {
         System.out.println("... Wrote " + SIZE + " files");
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-spring-javaconfig/src/test/java/org/apache/camel/example/spring/javaconfig/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-javaconfig/src/test/java/org/apache/camel/example/spring/javaconfig/IntegrationTest.java
b/examples/camel-example-spring-javaconfig/src/test/java/org/apache/camel/example/spring/javaconfig/IntegrationTest.java
index 77c828a..5f35530 100644
--- a/examples/camel-example-spring-javaconfig/src/test/java/org/apache/camel/example/spring/javaconfig/IntegrationTest.java
+++ b/examples/camel-example-spring-javaconfig/src/test/java/org/apache/camel/example/spring/javaconfig/IntegrationTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.example.spring.javaconfig;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.spring.javaconfig.Main;
+import org.apache.camel.util.IOHelper;
 import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.context.support.AbstractApplicationContext;
@@ -45,6 +46,6 @@ public class IntegrationTest extends Assert {
         Thread.sleep(2000);
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
index 0df51db..ff6417a 100644
--- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
+++ b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
@@ -18,6 +18,7 @@ package org.apache.camel.example.client;
 
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.util.IOHelper;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -46,7 +47,7 @@ public final class CamelClient {
         System.out.println("... the result is: " + response);
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
     // END SNIPPET: e1
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java
b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java
index 2a1b000..a4a4379 100644
--- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java
+++ b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java
@@ -21,6 +21,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Producer;
+import org.apache.camel.util.IOHelper;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -73,7 +74,7 @@ public final class CamelClientEndpoint {
         producer.stop();
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
     // END SNIPPET: e1
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
index ac7f4eb..dbbb3a7 100644
--- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
+++ b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
@@ -17,6 +17,7 @@
 package org.apache.camel.example.client;
 
 import org.apache.camel.example.server.Multiplier;
+import org.apache.camel.util.IOHelper;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -45,7 +46,7 @@ public final class CamelClientRemoting {
         System.out.println("... the result is: " + response);
 
         // we're done so let's properly close the application context
-        context.close();
+        IOHelper.close(context);
     }
     // END SNIPPET: e1
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java
index c36f4ad..e235667 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.itest.customerrelations;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.camel.util.IOHelper;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxws.EndpointImpl;
@@ -59,12 +60,7 @@ public class CustomerServicesTest extends Assert {
             assertNotNull("We should get Customer here", customer);
         } finally {
             // we're done so let's properly close the application contexts
-            if (clientContext != null) {
-                clientContext.close();
-            }
-            if (serverContext != null) {
-                serverContext.close();
-            }
+            IOHelper.close(clientContext, serverContext);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0dfba40b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
index 9ff77e0..616b3df 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesWsAddressingTest.java
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.camel.itest.customerrelations;
+import org.apache.camel.util.IOHelper;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -40,12 +41,7 @@ public class CustomerServicesWsAddressingTest extends Assert {
             assertNotNull("We should get Customer here", customer);
         } finally {
             // we're done so let's properly close the application context
-            if (clientContext != null) {
-                clientContext.close();
-            }
-            if (serverContext != null) {
-                serverContext.close();
-            }
+            IOHelper.close(clientContext, serverContext);
         }
     }
 


Mime
View raw message