org.silverpeas.mail.engine
Class MailSenderThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.silverpeas.mail.engine.MailSenderThread
All Implemented Interfaces:
Runnable

public class MailSenderThread
extends Thread

A thread MailSenderThread in the background a batch of mail sending. All the public methods are static, so only one thread runs and processes the mail sending.
When it get no more mail to send, the thread ends a new one will be instantiated on the next mail sending request.
Priority is given to synchronous mail sending request.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static void addMailToSend(MailToSend mailToSend)
          Add a mail to send.
 void run()
          Process all the requests.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addMailToSend

public static void addMailToSend(MailToSend mailToSend)
Add a mail to send.

Parameters:
mailToSend -

run

public void run()
Process all the requests. This method should be private but is already declared public in the base class Thread.

Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2016 Silverpeas. All Rights Reserved.