Class TestSmtpHandler

java.lang.Object
net.messagevortex.AbstractDaemon
net.messagevortex.transport.smtp.TestSmtpHandler
All Implemented Interfaces:
Runnable, RunningDaemon, Transport, TransportSender

public class TestSmtpHandler extends AbstractDaemon implements Transport, Runnable
FIXME: This implementation uses a Greenmail SMTP server. FIXME: It holds all in memory and gets thus slower and slower.
  • Constructor Details

    • TestSmtpHandler

      public TestSmtpHandler(String section) throws IOException

      Coinstructor getting parameters from named config section.

      Parameters:
      section - name of the config section
      Throws:
      IOException - if constructor fails to star SMTP server
  • Method Details

    • run

      public void run()

      Thread runner.

      Do not call this methode

      FIXME: move to private class
      Specified by:
      run in interface Runnable
    • startDaemon

      public final void startDaemon()
      Description copied from interface: RunningDaemon

      Initializes and starts all threads required to run the daemon.

      Specified by:
      startDaemon in interface RunningDaemon
      Overrides:
      startDaemon in class AbstractDaemon
    • shutdownDaemon

      public void shutdownDaemon()
      Description copied from interface: RunningDaemon

      Shuts this class down.

      This frees all resources and ends all threads for an application or layer shutdown. It is not possible to call start() after running shutdown().

      Specified by:
      shutdownDaemon in interface RunningDaemon
      Overrides:
      shutdownDaemon in class AbstractDaemon
    • sendMessage

      public void sendMessage(String address, InputStream os) throws IOException
      Description copied from interface: TransportSender

      sends a message on the transport layer.

      This method is called by the blender layer to send a message.

      Specified by:
      sendMessage in interface TransportSender
      Parameters:
      address - the string representation of the target address on the transport layer
      os - the outputstream providing the message
      Throws:
      IOException - if transport layer was unable to satisfy the request