|
ProProxy Home | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--proproxy.ProAbstractTCPListener
ProAbstractTCPListener
The TCP connection pooler and dispatcher. Waits for a new connection, creates a new
Processor for each new connection. Processors are cached in a
stack. Each Processor puts itself back to the cache when it is done
so that it can be used for the next request.
You are free to use this code and to make modifications provided
this notice is retained.
If you found this useful, please add a note of acknowledgement to my guestbook. If you would like to report a bug or suggest some improvements, you are most welcome. I will be happy to help you use this piece of code.
Constructor Summary | |
ProAbstractTCPListener(int iListenPort,
java.lang.String sIncludeList,
java.lang.String sExcludeList)
Save the connection parameters |
Method Summary | |
abstract void |
createAndProcessRequest(java.net.Socket newSocket)
|
boolean |
isListening()
|
abstract void |
processRequest(java.lang.Object processor,
java.net.Socket newSocket)
|
void |
pruneCache()
Check if there are too many processors in cache and remove extra ones |
void |
run()
The listener loop. |
void |
startListening()
If listener thread is stopped and not listening, start it. |
void |
stopListening()
If listener thread is active and listening, stop it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProAbstractTCPListener(int iListenPort, java.lang.String sIncludeList, java.lang.String sExcludeList)
Method Detail |
public void run()
run
in interface java.lang.Runnable
public abstract void createAndProcessRequest(java.net.Socket newSocket)
public abstract void processRequest(java.lang.Object processor, java.net.Socket newSocket)
public void pruneCache()
public void startListening()
public void stopListening()
public boolean isListening()
|
ProProxy Home | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |