You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/12/24 16:27:51 UTC

[2/2] git commit: CAMEL-7088: quartz component should close io stream.

CAMEL-7088: quartz component should close io stream.


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

Branch: refs/heads/camel-2.12.x
Commit: 79b6f562d75a1c9939babe8ae2ee78445b101910
Parents: a85acbc
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 24 16:30:21 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 24 16:30:35 2013 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/quartz/QuartzComponent.java     | 5 +++++
 .../org/apache/camel/component/quartz2/QuartzComponent.java    | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/79b6f562/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 93eb93c..15e14db 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -30,6 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.camel.CamelContext;
 import org.apache.camel.StartupListener;
 import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.quartz.CronTrigger;
@@ -426,6 +427,8 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
                 answer.load(is);
             } catch (IOException e) {
                 throw new SchedulerException("Error loading Quartz properties file from classpath: " + getPropertiesFile(), e);
+            } finally {
+                IOHelper.close(is);
             }
         }
         return answer;
@@ -460,6 +463,8 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
                 prop.load(is);
             } catch (IOException e) {
                 throw new SchedulerException("Error loading Quartz properties file from classpath: org/quartz/quartz.properties", e);
+            } finally {
+                IOHelper.close(is);
             }
 
             // camel context name will be a suffix to use one scheduler per context

http://git-wip-us.apache.org/repos/asf/camel/blob/79b6f562/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index bec1c47..6efbf85 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -27,6 +27,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.StartupListener;
 import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.quartz.Scheduler;
@@ -133,6 +134,8 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
                 prop.load(is);
             } catch (IOException e) {
                 throw new SchedulerException("Error loading Quartz properties file from classpath: org/quartz/quartz.properties", e);
+            } finally {
+                IOHelper.close(is);
             }
 
             // camel context name will be a suffix to use one scheduler per context
@@ -188,6 +191,8 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
                 answer.load(is);
             } catch (IOException e) {
                 throw new SchedulerException("Error loading Quartz properties file from classpath: " + getPropertiesFile(), e);
+            } finally {
+                IOHelper.close(is);
             }
         }
         return answer;
@@ -267,7 +272,6 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             name = host;
         }
 
-
         if (prefixJobNameWithEndpointId) {
             name = endpoint.getId() + "_" + name;
         }