Class BasicDrinkServer

java.lang.Object
  extended byBasicDrinkServer
Direct Known Subclasses:
FakeDrinkServer, LittleDrinkServer, TINIDrinkServer

public abstract class BasicDrinkServer
extends Object

A class to handle the configuration. Provided a set of functions to fetch the needed information to start the server. Basically, it handles overall server initialization.

Note on 'responsibilities':
ALL classes get the information they need from the ConfigMgr. No classes should take in their port to run on or the file to read from etc. They should only take in stuff like the AcctMgrSpec, DrinkLoggerSpec DrinkMachineSpec, ConfigMgr. The classes can then print what values they are using for what, and perform their own sanity checking. The only exceptions are things like so_acctsrvhost which is used in determining _which_ AcctMgrSpec implementation to use.

Boot order:
ConfigMgr
DrinkLoggerSpec
AcctMgrSpec
SundayServer
FingerServer
ClientServer

Version:
$Revision: #12 $
Author:
Kevin Thompson [antiduh@csh.rit.edu]

Field Summary
protected  AcctMgrSpec acct
          The AcctMgrSpec that we use for all account management and queries.
protected  ConfigMgr config
          The ConfigMgr that we get our config values from.
 String configfile
          The name of the file to read our config data from.
protected  DrinkLoggerSpec log
          The DrinkLoggerSpec that we use to log stuff.
 
Constructor Summary
BasicDrinkServer(String inConfigFile)
          Performs BasicDrinkServer class-specific initialization.
 
Method Summary
 void stage1()
          Performs drink software pre-initialization.
 void stage2(DrinkMachineSpec drink)
          Performs the second-half of the software initialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configfile

public String configfile
The name of the file to read our config data from.


config

protected ConfigMgr config
The ConfigMgr that we get our config values from.


log

protected DrinkLoggerSpec log
The DrinkLoggerSpec that we use to log stuff.


acct

protected AcctMgrSpec acct
The AcctMgrSpec that we use for all account management and queries.

Constructor Detail

BasicDrinkServer

public BasicDrinkServer(String inConfigFile)
Performs BasicDrinkServer class-specific initialization.

Parameters:
inConfigFile - The filename of the config to use.
Method Detail

stage1

public void stage1()
Performs drink software pre-initialization. The calling class first calls our constructor, then this function.That class then initializes its machine-specific DrinkMachineSpec implementation, then calls our stage2() method.


stage2

public void stage2(DrinkMachineSpec drink)
Performs the second-half of the software initialization. This method decides which services to run, and with what parameters to run them. This includes the Sunday, Client and Finger servers and the account client. TODO: ConfigMgr should be used better here.

Parameters:
drink - The DrinkMachineSpec implementation that is being used.