camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r790297 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/file/ components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/
Date Wed, 01 Jul 2009 18:18:41 GMT
Author: hadrian
Date: Wed Jul  1 18:18:40 2009
New Revision: 790297

URL: http://svn.apache.org/viewvc?rev=790297&view=rev
Log:
CAMEL-1078.  More cleanup.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java?rev=790297&r1=790296&r2=790297&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
Wed Jul  1 18:18:40 2009
@@ -45,12 +45,12 @@
 
     @SuppressWarnings("unchecked")
     public void onComplete(Exchange exchange) {
-        onCompletion((GenericFileExchange<T>) exchange);
+        onCompletion(exchange);
     }
 
     @SuppressWarnings("unchecked")
     public void onFailure(Exchange exchange) {
-        onCompletion((GenericFileExchange<T>) exchange);
+        onCompletion(exchange);
     }
 
     public ExceptionHandler getExceptionHandler() {
@@ -64,11 +64,11 @@
         this.exceptionHandler = exceptionHandler;
     }
 
-    protected void onCompletion(GenericFileExchange<T> exchange) {
+    protected void onCompletion(Exchange exchange) {
         GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
 
         // after processing
-        final GenericFile<T> file = exchange.getGenericFile();
+        final GenericFile<T> file = (GenericFile<T>) exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE);
         boolean failed = exchange.isFailed();
 
         if (log.isDebugEnabled()) {
@@ -107,7 +107,7 @@
      */
     @SuppressWarnings("unchecked")
     protected void processStrategyCommit(GenericFileProcessStrategy<T> processStrategy,
-                                         GenericFileExchange<T> exchange, GenericFile<T>
file) {
+                                         Exchange exchange, GenericFile<T> file) {
         if (endpoint.isIdempotent()) {
             // only add to idempotent repository if we could process the file
             // only use the filename as the key as the file could be moved into a done folder
@@ -132,7 +132,7 @@
      * @param file            the file processed
      */
     protected void processStrategyRollback(GenericFileProcessStrategy<T> processStrategy,
-                                           GenericFileExchange<T> exchange, GenericFile<T>
file) {
+                                           Exchange exchange, GenericFile<T> file)
{
         if (log.isWarnEnabled()) {
             log.warn("Rolling back remote file strategy: " + processStrategy + " for file:
" + file);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java?rev=790297&r1=790296&r2=790297&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
Wed Jul  1 18:18:40 2009
@@ -53,7 +53,7 @@
 
     @SuppressWarnings("unchecked")
     public void process(Exchange exchange) throws Exception {
-        GenericFileExchange<T> fileExchange = (GenericFileExchange<T>) endpoint.createExchange(exchange);
+        Exchange fileExchange = endpoint.createExchange(exchange);
         processExchange(fileExchange);
         ExchangeHelper.copyResults(exchange, fileExchange);
     }
@@ -64,7 +64,7 @@
      * @param exchange fileExchange
      * @throws Exception is thrown if some error
      */
-    protected void processExchange(GenericFileExchange<T> exchange) throws Exception
{
+    protected void processExchange(Exchange exchange) throws Exception {
         if (log.isTraceEnabled()) {
             log.trace("Processing " + exchange);
         }
@@ -109,7 +109,7 @@
      * If we fail writing out a file, we will call this method. This hook is
      * provided to disconnect from servers or clean up files we created (if needed).
      */
-    protected void handleFailedWrite(GenericFileExchange<T> exchange, Exception exception)
throws Exception {
+    protected void handleFailedWrite(Exchange exchange, Exception exception) throws Exception
{
         throw exception;
     }
 
@@ -119,7 +119,7 @@
     protected void preWriteCheck() throws Exception {
     }
 
-    protected void writeFile(GenericFileExchange<T> exchange, String fileName) throws
GenericFileOperationFailedException {
+    protected void writeFile(Exchange exchange, String fileName) throws GenericFileOperationFailedException
{
         InputStream payload = exchange.getIn().getBody(InputStream.class);
         try {
             // build directory if auto create is enabled

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java?rev=790297&r1=790296&r2=790297&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
Wed Jul  1 18:18:40 2009
@@ -20,7 +20,6 @@
 
 import org.apache.camel.Exchange;
 import org.apache.camel.ServicePoolAware;
-import org.apache.camel.component.file.GenericFileExchange;
 import org.apache.camel.component.file.GenericFileOperationFailedException;
 import org.apache.camel.component.file.GenericFileProducer;
 import org.apache.camel.util.ExchangeHelper;
@@ -50,7 +49,7 @@
     @SuppressWarnings("unchecked")
     public void process(Exchange exchange) throws Exception {
         Exchange remoteExchange = getEndpoint().createExchange(exchange);
-        processExchange((GenericFileExchange<T>)remoteExchange);
+        processExchange(remoteExchange);
         ExchangeHelper.copyResults(exchange, remoteExchange);
     }
 



Mime
View raw message