Holger's
Java API

com.antelmann.timeregister
Class PunchDBServer

java.lang.Object
  extended by com.antelmann.timeregister.PunchDBServer
All Implemented Interfaces:
Licensed, NetConnectionHandler

public class PunchDBServer
extends Object
implements NetConnectionHandler, Licensed

receives messages from a PunchDBClient and uses the given PunchDB

Author:
Holger Antelmann
See Also:
PunchDBClient, PunchServerFrame

Field Summary
static SimpleHandshake HANDSHAKE
           
 
Constructor Summary
PunchDBServer(PunchAdminDB db)
           
PunchDBServer(PunchAdminDB db, Logger logger)
           
 
Method Summary
 void connectionLost(NetConnection con)
          called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
 Logger getLogger()
           
 PunchDB getPunchDB()
           
 Stopwatch getStopwatch()
          retuns a stopwatch that captures the time for each handleMessage call
 void handleMessage(Object msg, NetConnection con)
          called when a message is received by the given NetConnection object
 void setLogger(Logger logger)
          must not be null; empty logger is ok
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDSHAKE

public static final SimpleHandshake HANDSHAKE
Constructor Detail

PunchDBServer

public PunchDBServer(PunchAdminDB db)

PunchDBServer

public PunchDBServer(PunchAdminDB db,
                     Logger logger)
Method Detail

getPunchDB

public PunchDB getPunchDB()

getLogger

public Logger getLogger()

getStopwatch

public Stopwatch getStopwatch()
retuns a stopwatch that captures the time for each handleMessage call


setLogger

public void setLogger(Logger logger)
must not be null; empty logger is ok


handleMessage

public void handleMessage(Object msg,
                          NetConnection con)
Description copied from interface: NetConnectionHandler
called when a message is received by the given NetConnection object

Specified by:
handleMessage in interface NetConnectionHandler

connectionLost

public void connectionLost(NetConnection con)
Description copied from interface: NetConnectionHandler
called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
Usually, it is a good idea to close the connection here explicitly.

Specified by:
connectionLost in interface NetConnectionHandler


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads