Class MailServer

java.lang.Object
org.apache.axis.transport.mail.MailServer
All Implemented Interfaces:
Runnable

public class MailServer extends Object implements Runnable
This is a simple implementation of an SMTP/POP3 server for processing SOAP requests via Apache's xml-axis. This is not intended for production use. Its intended uses are for demos, debugging, and performance profiling.
Author:
Davanum Srinivas invalid input: '<'dims@yahoo.com>, Rob Jellinghaus (robj@unrealities.com)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static org.apache.commons.logging.Log
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MailServer(String host, int port, String userid, String password)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static AxisServer
     
    boolean
     
     
    POP3Client
    Obtain the serverSocket that that MailServer is listening on.
    static void
    main(String[] args)
    Server process.
    void
    run()
    Accept requests from a given TCP port and send them through the Axis engine for processing.
    void
    setDoThreads(boolean value)
     
    void
    setPOP3(POP3Client pop3)
    Set the serverSocket this server should listen on.
    void
    Start this server as a NON-daemon.
    void
    start(boolean daemon)
    Start this server.
    void
    Stop this server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      protected static org.apache.commons.logging.Log log
  • Constructor Details

    • MailServer

      public MailServer(String host, int port, String userid, String password)
  • Method Details

    • setDoThreads

      public void setDoThreads(boolean value)
    • getDoThreads

      public boolean getDoThreads()
    • getHost

      public String getHost()
    • getAxisServer

      protected static AxisServer getAxisServer()
    • run

      public void run()
      Accept requests from a given TCP port and send them through the Axis engine for processing.
      Specified by:
      run in interface Runnable
    • getPOP3

      public POP3Client getPOP3()
      Obtain the serverSocket that that MailServer is listening on.
    • setPOP3

      public void setPOP3(POP3Client pop3)
      Set the serverSocket this server should listen on. (note : changing this will not affect a running server, but if you stop() and then start() the server, the new socket will be used).
    • start

      public void start(boolean daemon) throws Exception
      Start this server. Spawns a worker thread to listen for HTTP requests.
      Parameters:
      daemon - a boolean indicating if the thread should be a daemon.
      Throws:
      Exception
    • start

      public void start() throws Exception
      Start this server as a NON-daemon.
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Stop this server. This will interrupt any pending accept().
      Throws:
      Exception
    • main

      public static void main(String[] args)
      Server process.