james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wojciech Strzałka <wstrza...@gmail.com>
Subject Re[2]: svn commit: r1072621 - in /james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store: AbstractDelegatingMailboxListener.java StoreMailboxManager.java
Date Sun, 20 Feb 2011 18:25:58 GMT

  you mean setDelegatingMailboxListener() ??
  
  - thinking theoretically - yes
  - practically - I doubt as I don't see a reason why anybody would want
    to change it in the runtime. It's more like single time
    configuration parameter, isn't it?
    

> I think the methods need to be synchronized... wdyt ?

> Bye,
> Norman

> 2011/2/20  <wstrzalka@apache.org>:
>> Author: wstrzalka
>> Date: Sun Feb 20 16:17:31 2011
>> New Revision: 1072621
>>
>> URL: http://svn.apache.org/viewvc?rev=1072621&view=rev
>> Log:
>> Registering custom DelegatingMailboxListener in StoreMailboxManager property setter.
See IMAP-260
>>
>> Modified:
>>    james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/AbstractDelegatingMailboxListener.java
>>    james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
>>
>> Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/AbstractDelegatingMailboxListener.java
>> URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/AbstractDelegatingMailboxListener.java?rev=1072621&r1=1072620&r2=1072621&view=diff
>> ==============================================================================
>> --- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/AbstractDelegatingMailboxListener.java
(original)
>> +++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/AbstractDelegatingMailboxListener.java
Sun Feb 20 16:17:31 2011
>> @@ -30,6 +30,12 @@ import org.apache.james.mailbox.MailboxS
>>
>>  public abstract class AbstractDelegatingMailboxListener implements MailboxListener,
MailboxListenerSupport{
>>
>> +    private boolean isClosed;
>> +
>> +    protected AbstractDelegatingMailboxListener() {
>> +       isClosed = false;
>> +    }
>> +
>>     /**
>>      * Receive the event and dispatch it to the right {@link MailboxListener}
depending on {@link Event#getMailboxPath()}
>>      */
>> @@ -72,10 +78,17 @@ public abstract class AbstractDelegating
>>     }
>>
>>     /**
>> -     * Is never closed
>> +     * Close the listener
>> +     */
>> +    public void close() {
>> +       isClosed = true;
>> +    }
>> +
>> +    /**
>> +     * Check if closed
>>      */
>>     public boolean isClosed() {
>> -        return false;
>> +        return isClosed;
>>     }
>>
>>     /*
>>
>> Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
>> URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java?rev=1072621&r1=1072620&r2=1072621&view=diff
>> ==============================================================================
>> --- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
(original)
>> +++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
Sun Feb 20 16:17:31 2011
>> @@ -111,7 +111,10 @@ public abstract class StoreMailboxManage
>>      * @param delegatingListener
>>      */
>>     public void setDelegatingMailboxListener(AbstractDelegatingMailboxListener
delegatingListener) {
>> +       if(this.delegatingListener != null)
>> +               this.delegatingListener.close();
>>         this.delegatingListener = delegatingListener;
>> +        dispatcher.addMailboxListener(this.delegatingListener);
>>     }
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>

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



-- 
Pozdrowienia,
 Wojciech Strzalka


---------------------------------------------------------------------
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