org.apache.james.queue.api
Interface MailQueue


public interface MailQueue

A Queue/Spool for Mails. How the Queue handles the ordering of the dequeuing is up to the implementation. IMPORTANT: Implementations does not need to keep all Mail Attributes when enqueue emails. The implementations are only in the need of supporting at least this kind of Primitives as values: - Long - Byte - Integer - String - Boolean - Short - Float - Double


Nested Class Summary
static class MailQueue.MailQueueException
          Exception which will get thrown if any problems occur while working the MailQueue
static interface MailQueue.MailQueueItem
           
 
Method Summary
 MailQueue.MailQueueItem deQueue()
          Dequeue the next ready-to-process Mail of the queue.
 void enQueue(org.apache.mailet.Mail mail)
          Enqueue the Mail to the queue
 void enQueue(org.apache.mailet.Mail mail, long delay, java.util.concurrent.TimeUnit unit)
          Enqueue the Mail to the queue.
 

Method Detail

enQueue

void enQueue(org.apache.mailet.Mail mail,
             long delay,
             java.util.concurrent.TimeUnit unit)
             throws MailQueue.MailQueueException
Enqueue the Mail to the queue. The given delay and unit are used to calculate the time when the Mail will be avaible for dequeue

Parameters:
mail -
delay -
unit -
Throws:
MailQueue.MailQueueException

enQueue

void enQueue(org.apache.mailet.Mail mail)
             throws MailQueue.MailQueueException
Enqueue the Mail to the queue

Parameters:
mail -
Throws:
MailQueue.MailQueueException

deQueue

MailQueue.MailQueueItem deQueue()
                                throws MailQueue.MailQueueException
Dequeue the next ready-to-process Mail of the queue. This method will block until a Mail is ready and then process the DequeueOperation. Implementations should take care todo some kind of transactions to not loose any mail on error

Parameters:
dequeueOperation -
Throws:
MailQueue.MailQueueException


Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.