Author: norman
Date: Thu Jul 29 11:37:44 2010
New Revision: 980410

URL: http://svn.apache.org/viewvc?rev=980410&view=rev
Log:
Only add the delegatingMailboxListener one time

Modified:
    
james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java

Modified: 
james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java?rev=980410&r1=980409&r2=980410&view=diff
==============================================================================
--- 
james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
 (original)
+++ 
james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
 Thu Jul 29 11:37:44 2010
@@ -60,6 +60,7 @@ public abstract class StoreMailboxManage
     
     private final MailboxEventDispatcher dispatcher = new 
MailboxEventDispatcher();
     private final DelegatingMailboxListener delegatingListener = new 
DelegatingMailboxListener();   
+    
     protected final MailboxSessionMapperFactory<Id> 
mailboxSessionMapperFactory;
     private UidConsumer<Id> consumer;
     
@@ -68,6 +69,9 @@ public abstract class StoreMailboxManage
         super(authenticator, subscriber);
         this.consumer = consumer;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
+        
+        // The dispatcher need to have the delegating listener added
+        dispatcher.addMailboxListener(delegatingListener);
     }
     
     /**
@@ -114,9 +118,7 @@ public abstract class StoreMailboxManage
             } else {
                 getLog().debug("Loaded mailbox " + mailboxPath);
 
-                StoreMessageManager<Id> result = 
createMessageManager(dispatcher, consumer, mailboxRow, session);
-                result.addListener(delegatingListener);
-                return result;
+                return createMessageManager(dispatcher, consumer, mailboxRow, 
session);
             }
         }
     }
@@ -302,8 +304,7 @@ public abstract class StoreMailboxManage
                 final MailboxMapper<Id> mapper = 
mailboxSessionMapperFactory.getMailboxMapper(session);
                 mapper.findMailboxByPath(mailboxPath);
                 return true;
-            }
-            catch (MailboxNotFoundException e) {
+            } catch (MailboxNotFoundException e) {
                 return false;
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to