|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.arsdigita.mail.SimpleServer
A simple SMTP server for testing the ACS Mail service. This class provides one method, SimpleServer.startup(), that starts SMTP servers running on a range of ports on the local host. By default it redirects all mail traffic to the server running in NORMAL mode.
Using the SimpleServer.setMode() method, clients can force connections to any of the available servers running in that particular testing mode. The server threads are maintained statically, so additional calls to startup() are simply ignored.
Only the following SMTP operating modes are supported. Use these constants as the argument to setMode() to redirect SMTP traffic to the appropriate server.
Field Summary | |
static int |
HANGING
|
static int |
INSUFFICIENTMEM
|
static int |
INTERRUPT
|
static int |
NORMAL
|
static int |
SYNTAXERROR
|
static int |
TRANSACTIONABORT
|
static int |
TRANSACTIONFAILED
|
static int |
UNAVAILABLE
|
static int |
UNRECOGNIZEDCMD
|
static int |
UNSUPPORTEDMETH
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
static int |
getReceivedCount()
Gets the number of messages received. |
static int |
getSuccessCount()
Gets the number of succesfully processed connections to any SimpleServer. |
static void |
reset()
Resets the counters of received and successful messages. |
void |
run()
The run method for SimpleServer. |
static void |
setMode(int mode)
Configures the mail system to communicate with the correct server. |
static void |
startup()
Initializes the SimpleServer system. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NORMAL
public static final int INTERRUPT
public static final int HANGING
public static final int UNAVAILABLE
public static final int TRANSACTIONABORT
public static final int INSUFFICIENTMEM
public static final int UNRECOGNIZEDCMD
public static final int SYNTAXERROR
public static final int UNSUPPORTEDMETH
public static final int TRANSACTIONFAILED
Method Detail |
public static int getSuccessCount()
public static int getReceivedCount()
public static void reset()
public static void startup()
public static void setMode(int mode)
public void run()
run
in interface Runnable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |