com.prolixtech.jaminid
Class Daemon
Thread
com.prolixtech.jaminid.Daemon
public class Daemon
extends Thread
As in most HTTP implementations, the Daemon opens a port, listens for
incoming connections, and then spawns the connections to serve that
connection. Sometimes this is called the server, we already have plenty of
things in the works that will be called servers, so we're going for the what
was the original name of the process before Marketting got to it.
We're going for a no frills implementation that handles all the law level
stuff and delegates the production of content to what we call a
ContentOracle. This is a nice clean design that makes this code reusable.
On the subject of why an HTTP server vs a JSP implementation, we find this to
be a better approach. Less messy, makes the whole thing easier to install,
more controllable, faster - this is no frills. The code is centralized,
almost all of it in the server itself.
Daemon(int serverPort, ContentOracle cOra) - creates a new daemon and opens on specific port
|
Daemon(int serverPort, int backLog, InetAddress adr, ContentOracle cOra) - creates a new daemon and opens on specific port
|
VERSION
public static final String VERSION
Daemon
public Daemon(int serverPort,
ContentOracle cOra)
creates a new daemon and opens on specific port
serverPort
- the port to open oncOra
- the content oracle to use
Daemon
public Daemon(int serverPort,
int backLog,
InetAddress adr,
ContentOracle cOra)
creates a new daemon and opens on specific port
serverPort
- the port to open onbackLog
- maximum queue length. more concurrent connections will be
rejected. default: 50adr
- the address to bind to. null means any address found.cOra
- the content oracle to use
getProtocol
public Protocol getProtocol()
getServerPort
public int getServerPort()
returns the server port
isRunning
public boolean isRunning()
main
public static void main(args[] )
printlog
public void printlog(String message)
run
public void run()
Handles listening for new connections and launching client threads
tearDown
public void tearDown()
tears down server
tearDownAndWait
public void tearDownAndWait()
Tears down server and waits for it to tear down
toString
public String toString()