camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/5] git commit: Ensure camel-spring-batch shutdowns properly.
Date Fri, 24 May 2013 05:39:43 GMT
Ensure camel-spring-batch shutdowns properly.

Conflicts:
	components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java


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

Branch: refs/heads/camel-2.11.x
Commit: aa29385eeb828a927a04c9f73e663338918b9429
Parents: 2325b60
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri May 24 07:37:47 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri May 24 07:39:07 2013 +0200

----------------------------------------------------------------------
 .../spring/batch/support/CamelItemReader.java      |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/aa29385e/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java
b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java
index 01e7c08..e54c64e 100644
--- a/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java
+++ b/components/camel-spring-batch/src/main/java/org/apache/camel/component/spring/batch/support/CamelItemReader.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.spring.batch.support;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -25,26 +24,19 @@ import org.apache.camel.util.ServiceHelper;
 import org.springframework.batch.item.ItemReader;
 import org.springframework.beans.factory.InitializingBean;
 
-public class CamelItemReader<I> extends ServiceSupport implements ItemReader<I>,
InitializingBean, CamelContextAware {
+public class CamelItemReader<I> extends ServiceSupport implements ItemReader<I>,
InitializingBean {
 
-    private CamelContext camelContext;
+    private final CamelContext camelContext;
     private final ConsumerTemplate consumerTemplate;
 
     private final String endpointUri;
 
     public CamelItemReader(ConsumerTemplate consumerTemplate, String endpointUri) {
         this.consumerTemplate = consumerTemplate;
+        this.camelContext = consumerTemplate.getCamelContext();
         this.endpointUri = endpointUri;
     }
 
-    public CamelContext getCamelContext() {
-        return camelContext;
-    }
-
-    public void setCamelContext(CamelContext camelContext) {
-        this.camelContext = camelContext;
-    }
-
     @Override
     public void afterPropertiesSet() throws Exception {
         ObjectHelper.notNull(camelContext, "CamelContext", this);


Mime
View raw message