|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.bitmechanic.maxq.ProxyServer
public class ProxyServer
A proxy server. Creates a RequestHandler in a separate thread to handle each connection it receives. RequestHandlers call back here with the data for the requests and response being handled, and we pass this on to any observers that register themselves.
Nested Class Summary | |
---|---|
static interface |
ProxyServer.Observer
|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ProxyServer()
|
|
ProxyServer(int port)
Attempts to start a proxy server on the specified port. |
Method Summary | |
---|---|
void |
addObserver(ProxyServer.Observer proxy)
|
void |
processRequest(HttpRequestHeader header,
byte[] requestBody)
|
void |
processResponse(HttpRequestHeader header,
byte[] response)
|
void |
removeObserver(ProxyServer.Observer proxy)
|
void |
run()
|
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, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProxyServer() throws java.io.IOException
java.io.IOException
public ProxyServer(int port) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void addObserver(ProxyServer.Observer proxy)
public void removeObserver(ProxyServer.Observer proxy)
public void processRequest(HttpRequestHeader header, byte[] requestBody) throws java.lang.Exception
java.lang.Exception
public void processResponse(HttpRequestHeader header, byte[] response) throws java.lang.Exception
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |