com.admc.jamama.server.smtp
Class Server

java.lang.Object
  extended byAbstractDynamicMBean
      extended bycom.admc.jamama.server.smtp.Server
All Implemented Interfaces:
Configurable, MitGenerator, java.lang.Runnable, Server

public class Server
extends AbstractDynamicMBean
implements Server, MitGenerator

SMTP Server. N.b.: This does not implement Router YET. Once SmtpRouter is well tested, need to merge that functionality into this class, or maybe have this class have a private field that holds an SmtpRouter instance or have this class extend SmtpRouter instead of AbstractDynamicMBean (the latter sounds best). SmtpRouter needs to be a separate class for users who don't want any SMTP Server functionality but who still need to route mail out via SMTP.

Version:
$Revision: 1.15 $
Author:
Blaine Simpson
See Also:
Serialized Form

Constructor Summary
Server()
           
 
Method Summary
 void configure(java.lang.Object inCfg)
          Initialize the object's state with information in the given Jaxb object.
protected  MBeanAttributeInfo[] createMBeanAttributeInfo()
           
 java.lang.Object getConfig()
          Returns the Jaxb object used to configure this.
 int getConnectionCount()
           
 java.lang.String[] getConnections()
           
 Director getDirector()
           
 java.lang.String getHostname()
           
 int getMaxSessions()
           
protected  java.lang.String getMBeanDescription()
           
 java.lang.String getName()
          Name which Jamama config file uses to identify this object instance.
 int getPort()
           
 boolean getRun()
          Say whether main thread of this Server is running.
 boolean isRun()
           
static void main(java.lang.String[] sa)
          Just for testing.
 void restoreRunState()
          Start up server iff server is configured to start automatically.
 void run()
          Main thread
 void setDebug(boolean inDebug)
           
 void setDirector(Director inDirector)
          Sets the Director who actually does the Mit creation work.
 void setHostname(java.lang.String inHostname)
           
 void setMaxSessions(int inMaxSess)
           
 void setPort(int inPort)
           
 void setRun(boolean inRun)
          Start or stop the main thread in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server()
Method Detail

isRun

public boolean isRun()
See Also:
Server

getMaxSessions

public int getMaxSessions()

setMaxSessions

public void setMaxSessions(int inMaxSess)

getRun

public boolean getRun()
Description copied from interface: Server
Say whether main thread of this Server is running.

Specified by:
getRun in interface Server
Returns:
Indication of whether Server main thread is running.
See Also:
Server

restoreRunState

public void restoreRunState()
Description copied from interface: Server
Start up server iff server is configured to start automatically.

Specified by:
restoreRunState in interface Server
See Also:
Server

createMBeanAttributeInfo

protected MBeanAttributeInfo[] createMBeanAttributeInfo()

getConnectionCount

public int getConnectionCount()

getConnections

public java.lang.String[] getConnections()

getMBeanDescription

protected java.lang.String getMBeanDescription()

main

public static void main(java.lang.String[] sa)
                 throws java.lang.Exception
Just for testing. In production will always be invoked by Jamama.

Throws:
java.lang.Exception

setHostname

public void setHostname(java.lang.String inHostname)

getHostname

public java.lang.String getHostname()

setPort

public void setPort(int inPort)

getPort

public int getPort()

setRun

public void setRun(boolean inRun)
Description copied from interface: Server
Start or stop the main thread in this object.

Specified by:
setRun in interface Server
Parameters:
inRun - true to start up thread; false to stop it
See Also:
Server

run

public void run()
Main thread

Specified by:
run in interface java.lang.Runnable

configure

public void configure(java.lang.Object inCfg)
Description copied from interface: Configurable
Initialize the object's state with information in the given Jaxb object.

Specified by:
configure in interface Configurable
Parameters:
inCfg - A Jaxb object corresponding to a XML document branch.
See Also:
Configurable

getName

public java.lang.String getName()
Description copied from interface: Configurable
Name which Jamama config file uses to identify this object instance.

Specified by:
getName in interface Configurable
See Also:
Configurable

getConfig

public java.lang.Object getConfig()
Description copied from interface: Configurable
Returns the Jaxb object used to configure this.

Specified by:
getConfig in interface Configurable
See Also:
Configurable

setDirector

public void setDirector(Director inDirector)
Description copied from interface: MitGenerator
Sets the Director who actually does the Mit creation work.

Specified by:
setDirector in interface MitGenerator
Parameters:
inDirector -
See Also:
MitGenerator

getDirector

public Director getDirector()
Specified by:
getDirector in interface MitGenerator
Returns:
Director that this MitGenerator uses to create Mits

setDebug

public void setDebug(boolean inDebug)