javatools.smtp
Class SmtpListener

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.smtp.SmtpListener
All Implemented Interfaces:
Resetable, java.lang.Runnable, Server

public abstract class SmtpListener
extends java.lang.Thread
implements Server, Resetable

A class which listens for incoming SMTP connections. You will need to implement the newProcessor to return an instance of a class which inherits SmtpProcessor which can process a single email message.


Field Summary
(package private)  java.io.IOException exception
           
(package private)  java.net.ServerSocket serverSocket
           
static java.lang.String thisDomain
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SmtpListener(int port, java.lang.String domain)
           
 
Method Summary
abstract  SmtpProcessor newProcessor(java.net.Socket socket, java.lang.ThreadGroup threadGroup)
           
 void reset()
           
 void run()
           
 void shutdown()
          Shutdown this server thread.
 
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

thisDomain

public static java.lang.String thisDomain

exception

java.io.IOException exception

serverSocket

java.net.ServerSocket serverSocket
Constructor Detail

SmtpListener

public SmtpListener(int port,
                    java.lang.String domain)
             throws java.io.IOException
Method Detail

reset

public void reset()
           throws ResetException
Specified by:
reset in interface Resetable
ResetException

shutdown

public void shutdown()
Description copied from interface: Server
Shutdown this server thread.

Specified by:
shutdown in interface Server

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

newProcessor

public abstract SmtpProcessor newProcessor(java.net.Socket socket,
                                           java.lang.ThreadGroup threadGroup)
                                    throws SmtpException
SmtpException