com.ericdaugherty.mail.server.services.general
Class ServiceListener

java.lang.Object
  extended by com.ericdaugherty.mail.server.services.general.ServiceListener
All Implemented Interfaces:
java.lang.Runnable

public class ServiceListener
extends java.lang.Object
implements java.lang.Runnable

This class listens for incoming connections on the specified port and starts a new thread to process the request. This class abstracts common functinality required to start any type of service (POP3 or SMTP), reducing the requirement to duplicate this code in each package.

Author:
Eric Daugherty, Andreas Kyrrmegalos (2.x branch)

Constructor Summary
ServiceListener(int port, java.lang.Class connectionProcessorClass, int threads, boolean useSSL)
          Creates a new instance and stores the initial paramters.
 
Method Summary
static java.lang.Object getLock()
           
 int getPort()
           
 void initiateshutdown()
          All processors are allowed to stop in sequence.
static boolean isSLsloadingComplete()
           
 void notifyshutdown()
          This method notifies all processors to initiate shutdown.
 void run()
          Entry point for the thread.
static void setTotalSL(int totalSL)
           
 java.lang.Runnable updateServerSocket(int newPort)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceListener

public ServiceListener(int port,
                       java.lang.Class connectionProcessorClass,
                       int threads,
                       boolean useSSL)
Creates a new instance and stores the initial paramters.

Method Detail

setTotalSL

public static void setTotalSL(int totalSL)

getLock

public static java.lang.Object getLock()

isSLsloadingComplete

public static boolean isSLsloadingComplete()

getPort

public int getPort()

run

public void run()
Entry point for the thread. Listens for incoming connections and start a new handler thread for each.

Specified by:
run in interface java.lang.Runnable

notifyshutdown

public void notifyshutdown()
This method notifies all processors to initiate shutdown.


initiateshutdown

public void initiateshutdown()
All processors are allowed to stop in sequence.


updateServerSocket

public java.lang.Runnable updateServerSocket(int newPort)