com.hs.mail.mailet
Interface Mailet

All Known Implementing Classes:
AbstractMailet, AliasingForwarding, LocalDelivery, RemoteDelivery, ToRepository

public interface Mailet

Since:
Jun 7, 2010
Author:
Won Chul Doh

Method Summary
 boolean accept(Set<Recipient> recipients, SmtpMessage message)
          Check if the mailet is interested in the given recipients and message.
 void init(MailetContext context)
          Initialize the mailet.
 void service(Set<Recipient> recipients, SmtpMessage message)
          Called by the SmtpMessageConsumer to allow the mailet to process the message.
 

Method Detail

init

void init(MailetContext context)
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.


accept

boolean accept(Set<Recipient> recipients,
               SmtpMessage message)
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.

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

void service(Set<Recipient> recipients,
             SmtpMessage message)
             throws javax.mail.MessagingException
Called by the SmtpMessageConsumer to allow the mailet to process the message.

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


Copyright © 2011. All Rights Reserved.