kom.smtpd
Class SMTPD

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--kom.tools.ipc.IPCServer
              |
              +--kom.smtpd.SMTPD

public class SMTPD
extends IPCServer

This is a subclass of IPCServer, adapted to the SMTP protocol


Inner Class Summary
(package private)  class SMTPD.SMTPLogThread
           
 
Field Summary
protected  AccessControl access
           
protected  SMTPConfig config
           
protected  SMTPDispatcher dispatcher
           
protected  ObservableVector freeThreads
           
protected  UniqueId id
           
protected  SMTPLog log
           
protected  java.util.Vector logdata
           
protected  NameFinder[] namefinders
           
protected  java.util.Hashtable preload
           
protected  java.util.Vector threads
           
 
Fields inherited from class kom.tools.ipc.IPCServer
port, socket
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
SMTPD(int port, SMTPConfig config, SMTPLog log)
          Constructor
 
Method Summary
 void addLog(SMTPRequestLog log)
           
 void addThreadObserver(java.util.Observer obs)
          Adds a thread observer
 void deleteThreadObserver(java.util.Observer obs)
          Removes the thread observer
 long getThreadNumber()
          Get number of threads
 void handle(IPCConnection connection)
          Performs an action for the incoming connection
 void log(SMTPRequestLog requestLog)
           
static void main(java.lang.String[] args)
          The main program.
protected  void preloadClasses()
          Loads some classes
 
Methods inherited from class kom.tools.ipc.IPCServer
accept, bind, run, start
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

config

protected SMTPConfig config

access

protected AccessControl access

preload

protected java.util.Hashtable preload

id

protected UniqueId id

dispatcher

protected SMTPDispatcher dispatcher

freeThreads

protected ObservableVector freeThreads

threads

protected java.util.Vector threads

logdata

protected java.util.Vector logdata

log

protected SMTPLog log

namefinders

protected NameFinder[] namefinders
Constructor Detail

SMTPD

public SMTPD(int port,
             SMTPConfig config,
             SMTPLog log)
Constructor
Parameters:
port - Port number on which this server listens for connections
config - A configuration instance
log - Reference to SMTPlog thread
Method Detail

log

public void log(SMTPRequestLog requestLog)

addLog

public void addLog(SMTPRequestLog log)

getThreadNumber

public long getThreadNumber()
Get number of threads

addThreadObserver

public void addThreadObserver(java.util.Observer obs)
Adds a thread observer

deleteThreadObserver

public void deleteThreadObserver(java.util.Observer obs)
Removes the thread observer

preloadClasses

protected void preloadClasses()
Loads some classes

handle

public void handle(IPCConnection connection)
Performs an action for the incoming connection
Overrides:
handle in class IPCServer
Parameters:
connection - The incoming connection

main

public static void main(java.lang.String[] args)
The main program. Reads the configuration file, creates an instance of the Dispatcher class and then calls its start method.
Parameters:
args - List with arguments for this program.
The first argument is the port on which this server is listening.
The second argument is the name of the configuration file.