james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r754838 - /james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
Date Mon, 16 Mar 2009 08:18:14 GMT
Author: rdonkin
Date: Mon Mar 16 08:18:14 2009
New Revision: 754838

URL: http://svn.apache.org/viewvc?rev=754838&view=rev
Log:
Consolidate duplicated code IMAP-67 https://issues.apache.org/jira/browse/IMAP-67

Modified:
    james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java

Modified: james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java?rev=754838&r1=754837&r2=754838&view=diff
==============================================================================
--- james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
(original)
+++ james/protocols/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
Mon Mar 16 08:18:14 2009
@@ -55,28 +55,19 @@
     public void added(long uid, long sessionId) {
         pruneClosed();
         final AddedImpl added = new AddedImpl(sessionId, uid);
-        for (Iterator iter = listeners.iterator(); iter.hasNext();) {
-            MailboxListener mailboxListener = (MailboxListener) iter.next();
-            mailboxListener.event(added);
-        }
+        event(added);
     }
 
     public void expunged(final long uid, long sessionId) {
         final ExpungedImpl expunged = new ExpungedImpl(sessionId, uid);
-        for (Iterator iter = listeners.iterator(); iter.hasNext();) {
-            MailboxListener mailboxListener = (MailboxListener) iter.next();
-            mailboxListener.event(expunged);
-        }
+        event(expunged);
     }
 
     public void flagsUpdated(final long uid, long sessionId,
             final Flags original, final Flags updated) {
         final FlagsUpdatedImpl flags = new FlagsUpdatedImpl(sessionId, uid,
                 original, updated);
-        for (Iterator iter = listeners.iterator(); iter.hasNext();) {
-            MailboxListener mailboxListener = (MailboxListener) iter.next();
-            mailboxListener.event(flags);
-        }
+        event(flags);
     }
 
     public void event(Event event) {
@@ -243,10 +234,7 @@
     public void mailboxDeleted(long sessionId) {
         final MailboxDeletionEventImpl event = new MailboxDeletionEventImpl(
                 sessionId);
-        for (Iterator iter = listeners.iterator(); iter.hasNext();) {
-            MailboxListener mailboxListener = (MailboxListener) iter.next();
-            mailboxListener.event(event);
-        }
+        event(event);
     }
 
     private static final class MailboxDeletionEventImpl implements



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message