|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.prolixtech.jaminid.Daemon
public class Daemon
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
VERSION
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Daemon(int serverPort,
ContentOracle cOra)
creates a new daemon and opens on specific port |
Method Summary | |
---|---|
ContentOracle |
getOracle()
|
Protocol |
getProtocol()
|
int |
getServerPort()
returns the server port |
boolean |
isRunning()
|
static void |
main(java.lang.String[] args)
|
void |
printlog(java.lang.String message)
|
void |
run()
Handles listening for new connections and launching client threads |
void |
tearDown()
tears down server |
void |
tearDownAndWait()
Tears down server and waits for it to tear down |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
Constructor Detail |
---|
public Daemon(int serverPort, ContentOracle cOra)
serverPort
- the port to open oncOra
- the content oracle to useMethod Detail |
---|
public int getServerPort()
public Protocol getProtocol()
public ContentOracle getOracle()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String toString()
toString
in class java.lang.Thread
public static void main(java.lang.String[] args)
public void printlog(java.lang.String message)
public boolean isRunning()
public void tearDown()
public void tearDownAndWait()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |