org.apache.james.transport.mailets
Class RemoteDelivery

java.lang.Object
  |
  +--org.apache.mailet.GenericMailet
        |
        +--org.apache.james.transport.mailets.RemoteDelivery
All Implemented Interfaces:
Mailet, MailetConfig, java.lang.Runnable

public class RemoteDelivery
extends GenericMailet
implements java.lang.Runnable

Receive a MessageContainer from JamesSpoolManager and takes care of delivery the message to remote hosts. If for some reason mail can't be delivered store it in the "outgoing" Repository and set an Alarm. After "delayTime" the Alarm will wake the servlet that will try to send it again. After "maxRetries" the mail will be considered underiverable and will be returned to sender. TO DO (in priority): 1. Support a gateway (a single server where all mail will be delivered) (DONE) 2. Provide better failure messages (DONE) 3. More efficiently handle numerous recipients 4. Migrate to use Phoenix for the delivery threads

Author:
Serge Knystautas , Federico Barbieri This is $Revision: 1.10 $ Committed on $Date: 2001/10/20 12:56:48 $ by: $Author: serge $

Constructor Summary
RemoteDelivery()
           
 
Method Summary
 void destroy()
          Called by the mailer container to indicate to a mailet that the mailet is being taken out of service.
 java.lang.String getMailetInfo()
          Returns information about the mailet, such as author, version, and copyright.
 void init()
          A convenience method which can be overridden so that there's no need to call super.init(config).
 void run()
          Handles checking the outgoing spool for new mail and delivering them if there are any
 void service(Mail genericmail)
          For this message, we take the list of recipients, organize these into distinct servers, and duplicate the message for each of these servers, and then call the deliver (messagecontainer) method for each server-specific messagecontainer ...
 
Methods inherited from class org.apache.mailet.GenericMailet
getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteDelivery

public RemoteDelivery()
Method Detail

init

public void init()
          throws javax.mail.MessagingException
Description copied from class: GenericMailet
A convenience method which can be overridden so that there's no need to call super.init(config). Instead of overriding init(MailetConfig), simply override this method and it will be called by GenericMailet.init(MailetConfig config). The MailetConfig object can still be retrieved via getMailetConfig().
Overrides:
init in class GenericMailet
Following copied from class: org.apache.mailet.GenericMailet
Throws:
javax.mail.MessagingException - if an exception occurs that interrupts the mailet's normal operation

getMailetInfo

public java.lang.String getMailetInfo()
Description copied from class: GenericMailet
Returns information about the mailet, such as author, version, and copyright. By default, this method returns an empty string. Override this method to have it return a meaningful value.
Overrides:
getMailetInfo in class GenericMailet
Following copied from class: org.apache.mailet.GenericMailet
Returns:
String information about this mailet, by default an empty string

service

public void service(Mail genericmail)
             throws javax.mail.internet.AddressException
For this message, we take the list of recipients, organize these into distinct servers, and duplicate the message for each of these servers, and then call the deliver (messagecontainer) method for each server-specific messagecontainer ... that will handle storing it in the outgoing queue if needed.
Overrides:
service in class GenericMailet
Parameters:
mail - org.apache.mailet.Mail
Returns:
org.apache.mailet.MessageContainer

destroy

public void destroy()
Description copied from class: GenericMailet
Called by the mailer container to indicate to a mailet that the mailet is being taken out of service.
Overrides:
destroy in class GenericMailet

run

public void run()
Handles checking the outgoing spool for new mail and delivering them if there are any
Specified by:
run in interface java.lang.Runnable


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.