|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.jcoderz.commons.connector.http.transport.SimpleServer
public class SimpleServer
This class defines a simple http server used for testing the HttpConnectionImpl based on the commons-httpclient lib.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SimpleServer(int port)
Constructor. |
|
| Method Summary | |
|---|---|
void |
doStop()
Sets the flag for stopping the server. |
boolean |
haveToStop()
Checks the flag for stopping the server. |
boolean |
isServerStarted()
Returns true if the server has been started. |
static void |
main(String[] args)
Main method. |
void |
run()
Starts the server thread. |
void |
startServer()
Creates a client socket for every incoming request and creates a ClientHandler thread to handle the request/response. |
void |
stopServer()
Stops the client handler threads. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, 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, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleServer(int port)
port - the server port in use| Method Detail |
|---|
public static void main(String[] args)
args - args include the port number to usepublic void run()
run in interface Runnablerun in class Threadpublic void startServer()
public void doStop()
public boolean haveToStop()
public void stopServer()
public boolean isServerStarted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||