talx x1.0.5

talx.model.filters
Class TrashDateMonitor

java.lang.Object
  extended bytalx.model.filters.ReceiverFilterAdapter
      extended bytalx.model.filters.TrashDateMonitor
All Implemented Interfaces:
DelayedFeature, java.util.EventListener, ReceiverFilter, ReceiverFilterListener, java.lang.Runnable, TALFeature

public class TrashDateMonitor
extends ReceiverFilterAdapter
implements DelayedFeature, java.lang.Runnable

Removes old messages from the trash.


Constructor Summary
TrashDateMonitor(TransportToolkit model, java.lang.String param)
           
 
Method Summary
protected  boolean filterMessage(javax.mail.internet.MimeMessage msg)
          Always returns true.
 void initialize()
          Called to initialize the feature.
 void release()
          Releases all system resources held by this object.
 void run()
           
 
Methods inherited from class talx.model.filters.ReceiverFilterAdapter
addFilterListener, filterActivated, fireFilterActivated, fireNewMailEvent, newMailArrived, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrashDateMonitor

public TrashDateMonitor(TransportToolkit model,
                        java.lang.String param)
Parameters:
param - String consisting of a single number. The number is the number of days that a message is allowed to remain in the trash before being permanently removed. This feature only runs once at start up.
Throws:
java.lang.NumberFormatException - if the parameter string is malformed.
Method Detail

initialize

public void initialize()
Description copied from interface: DelayedFeature
Called to initialize the feature. See the Email class for details of the load sequence.

Specified by:
initialize in interface DelayedFeature

run

public void run()
Specified by:
run in interface java.lang.Runnable

release

public void release()
Description copied from interface: TALFeature
Releases all system resources held by this object. The general contract of pluggable features is that once their release method is called, they should be elligible for garbage collection. The exceptions to this are references to this object held in the ActionDispatcher and in the Transport model. Both of those objects are cleared by the system. However, in all other cases, if this object subscribed to a listener interface, it must unsubscribe in this method. This method should block until all object clean-up has been accomplished. This includes closing all open files, etc. Once the object has returned from the release method, the system may go down without further warning.

Specified by:
release in interface TALFeature
Overrides:
release in class ReceiverFilterAdapter

filterMessage

protected boolean filterMessage(javax.mail.internet.MimeMessage msg)
Always returns true. This class is only a filter because it needs access to the store, and non-filter features don't have that. So, it never drops any messages. It just passes them through the chain.

Specified by:
filterMessage in class ReceiverFilterAdapter
Parameters:
msg - The message to be filtered by this method.
Returns:
true if the message should be passed along, false if the message should be dropped.

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.