camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r884525 - /camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
Date Thu, 26 Nov 2009 11:18:55 GMT
Author: davsclaus
Date: Thu Nov 26 11:18:55 2009
New Revision: 884525

URL: http://svn.apache.org/viewvc?rev=884525&view=rev
Log:
CAMEL-2231: Ensure folder get recreated when reconnection in camel-mail.

Modified:
    camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java

Modified: camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java?rev=884525&r1=884524&r2=884525&view=diff
==============================================================================
--- camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
(original)
+++ camel/trunk/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
Thu Nov 26 11:18:55 2009
@@ -234,6 +234,10 @@
         }
 
         if (!connected) {
+            // ensure resources get recreated on reconnection
+            store = null;
+            folder = null;
+
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Connecting to MailStore: " + endpoint.getConfiguration().getMailStoreLogInformation());
             }
@@ -242,6 +246,9 @@
         }
 
         if (folder == null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Getting folder " + config.getFolderName());
+            }
             folder = store.getFolder(config.getFolderName());
             if (folder == null || !folder.exists()) {
                 throw new FolderNotFoundException(folder, "Folder not found or invalid: "
+ config.getFolderName());



Mime
View raw message