de.bb.bejy
Class Factory

java.lang.Object
  |
  +--de.bb.bejy.Factory

public abstract class Factory
extends java.lang.Object

base class for all protocol factories

In the configuration there is a protocol assigned to each server. That means the class of the protocol factory is specified. For each new server object the factory's create() function is invoked to create a new protocol object. The server keeps that protocol object and manages the sockets and input/output streams for that protocol object. Depending on the return value the socket is kept alive or closed. If an Exception is caught, the server and the protocol object are discarded. The mechanism behind (ThreadManager) creates server objects on demand.

See Also:
Protocol

Field Summary
protected  XmlFile ini
          the configuration file
protected  LogFile logFile
          a logfile for this protocol
protected  java.lang.String name
          name of the current Factory without package e.g.
protected  java.lang.String section
          name of own the loaded Factory with package path e.g. de.bb.bejy.mail.Pop3
 
Constructor Summary
Factory()
           
 
Method Summary
abstract  Protocol create()
          is invoked to create a new protocol object
abstract  java.lang.String getFull()
          returns a full version string of the current protocol
abstract  java.lang.String getVersion()
          returns the version number of the current protocol
abstract  void load(XmlFile ini, java.lang.String sName)
          is invoked on each protocol object after create(), to load its configuration
 void save(XmlFile ini)
          is invoked to update the configuration file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

section

protected java.lang.String section
name of own the loaded Factory with package path e.g. de.bb.bejy.mail.Pop3

name

protected java.lang.String name
name of the current Factory without package e.g. Pop3

logFile

protected LogFile logFile
a logfile for this protocol

ini

protected XmlFile ini
the configuration file
Constructor Detail

Factory

public Factory()
Method Detail

create

public abstract Protocol create()
is invoked to create a new protocol object

load

public abstract void load(XmlFile ini,
                          java.lang.String sName)
                   throws java.lang.Exception
is invoked on each protocol object after create(), to load its configuration
Parameters:
ini - the config file object
sName - the section to retrieve data from
Throws:
java.lang.Exception -  

save

public void save(XmlFile ini)
is invoked to update the configuration file
Parameters:
ini - the config file object

getVersion

public abstract java.lang.String getVersion()
returns the version number of the current protocol

getFull

public abstract java.lang.String getFull()
returns a full version string of the current protocol