|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.email.MailQueue
public final class MailQueue
is the MailQueue singleton of the pulse container.
The MailQueue is used to send mails from the pulse
container. Mails will be delivered in specified intervals to an MTA. The
configuration can be found in pulse.xml.
... <mail-queue interval="10000"> <protocol>smtp</protocol> <server port="25">localhost</server> <user>mail-user</user> <password>pass</password> <temporary-directory>/tmp</temporary-directory> </mail-queue> ...
All values are optional and default to:
interval |
<em>10000</em> |
protocol |
<em>smtp</em> |
server |
<em>localhost</em> |
port |
<em>25</em> |
user |
no user, do not use authentication |
password |
no password |
temporary-directory |
<em>java.io.tmpdir</em> |
Mails that are still in the queue during shutdowns are stored in the given temporary directory and reloaded on startup.
| Field Summary | |
|---|---|
static java.lang.String |
STORE_FILE_NAME
the name of the file for storing unprocessed queue items. |
| Method Summary | |
|---|---|
void |
add(Email email)
adds an Email to the queue. |
void |
add(javax.mail.internet.MimeMessage mm)
adds an MimeMessage to the queue. |
protected void |
finalize()
tries to save the queue, if the MailQueue has not been stopped
already. |
protected MailQueueConfiguration |
getConfiguration()
returns the configuration for the SendingTask. |
protected java.util.concurrent.ConcurrentLinkedQueue<QueueItem> |
getCurrentQueue()
getter used by the send task. |
static MailQueue |
getInstance(MailQueueConfiguration conf)
the MailQueue singleton. |
boolean |
isModified()
always returns false. |
protected boolean |
isStopped()
returns whether the MailQueue is stopped. |
void |
reconfigure(MailQueueConfiguration conf)
reconfigures the MailQueue at runtime (used by Lifecycle$WatchDog). |
void |
restart()
Deprecated. |
protected void |
sendMessage(javax.mail.internet.MimeMessage message,
javax.mail.Transport transport)
used by the SendingTask to actually send a message. |
void |
shutdown()
stops the MailQueue. |
void |
startup()
starts the MailQueue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STORE_FILE_NAME
| Method Detail |
|---|
public static MailQueue getInstance(MailQueueConfiguration conf)
MailQueue singleton.
conf - the configuration
MailQueue singletonpublic void add(Email email)
Email to the queue.
email - the e-mail to addpublic void add(javax.mail.internet.MimeMessage mm)
MimeMessage to the queue.
mm - the MIME message to addprotected java.util.concurrent.ConcurrentLinkedQueue<QueueItem> getCurrentQueue()
protected MailQueueConfiguration getConfiguration()
SendingTask.
SendingTask.protected boolean isStopped()
MailQueue is stopped.
true, if the MailQueue is stopped
protected void sendMessage(javax.mail.internet.MimeMessage message,
javax.mail.Transport transport)
throws javax.mail.MessagingException
SendingTask to actually send a message.
message - the messagetransport - the transport
javax.mail.MessagingException - on errors sending the messagepublic boolean isModified()
false.
isModified in interface LifecycleResourcefalse
@Deprecated
public void restart()
throws LifecycleException
Calls to this method will always cause a LifecycleException.
restart in interface LifecycleResourceLifecycleException - always, since the method is not supportedpublic void shutdown()
MailQueue.
shutdown in interface LifecycleResourcepublic void startup()
MailQueue.
startup in interface LifecycleResourcepublic void reconfigure(MailQueueConfiguration conf)
MailQueue at runtime (used by Lifecycle$WatchDog).
conf - the new configuration
protected void finalize()
throws java.lang.Throwable
MailQueue has not been stopped
already.
finalize in class java.lang.Objectjava.lang.Throwable - on errorsObject.finalize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||