com.hs.mail.mailet
Class AbstractMailet

java.lang.Object
  extended by com.hs.mail.mailet.AbstractMailet
All Implemented Interfaces:
Mailet
Direct Known Subclasses:
AliasingForwarding, LocalDelivery, RemoteDelivery, ToRepository

public abstract class AbstractMailet
extends Object
implements Mailet


Field Summary
protected  MailetContext context
           
 
Constructor Summary
AbstractMailet()
           
 
Method Summary
 boolean accept(Set<Recipient> recipients, SmtpMessage message)
          Check if the mailet is interested in the given recipients and message.
protected  MailboxManager getMailboxManager()
           
protected  UserManager getUserManager()
           
 void init(MailetContext context)
          Initialize the mailet.
abstract  void service(Set<Recipient> recipients, SmtpMessage message)
          Called by the SmtpMessageConsumer to allow the mailet to process the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected MailetContext context
Constructor Detail

AbstractMailet

public AbstractMailet()
Method Detail

init

public void init(MailetContext context)
Description copied from interface: Mailet
Initialize the mailet. Called by the SmtpMessageConsumer to indicate to a mailet that the mailet is being placed into service.

The SmtpMessageConsumer calls the init method exactly once after instantiating the mailet. The init method must complete successfully before the mailet can receive any requests.

Specified by:
init in interface Mailet

accept

public boolean accept(Set<Recipient> recipients,
                      SmtpMessage message)
Description copied from interface: Mailet
Check if the mailet is interested in the given recipients and message. If this method returns false, the service method will not be called for this message.

Specified by:
accept in interface Mailet
Parameters:
recipients - collection of recipients this mailet must process
message - the Mail object that contains the message and routing information
Returns:
true if the mailet want to process the message, otherwise false

service

public abstract void service(Set<Recipient> recipients,
                             SmtpMessage message)
                      throws javax.mail.MessagingException
Description copied from interface: Mailet
Called by the SmtpMessageConsumer to allow the mailet to process the message.

Specified by:
service in interface Mailet
Parameters:
recipients - collection of recipients this mailet must process
message - the Mail object that contains the message and routing information
Throws:
javax.mail.MessagingException

getUserManager

protected UserManager getUserManager()

getMailboxManager

protected MailboxManager getMailboxManager()


Copyright © 2011. All Rights Reserved.