|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ProxyConnection
Represents a connection between a client and a server; a static thread manager manages the number of active and existing threads, and a static ServerSocket waits for connections.
Field Summary | |
(package private) java.io.InputStream |
clientSideIn
inputstream from the client |
(package private) java.io.OutputStream |
clientSideOut
outputstream to the client |
(package private) java.net.Socket |
clientSideSocket
the interface with the client |
(package private) static ThreadManager |
man
manages the number of active and existing threads |
(package private) boolean |
mustCloseConnection
to verify if the connection must be closed |
(package private) java.io.InputStream |
serverSideIn
inputstream from the server |
(package private) java.io.OutputStream |
serverSideOut
outputstream to the server |
(package private) java.net.Socket |
serverSideSocket
the interface with the server |
(package private) static java.net.ServerSocket |
serverSocket
all the connection are catched on this ServerSocket |
Constructor Summary | |
(package private) |
ProxyConnection()
Default constructor, used by the ThreadManager. |
(package private) |
ProxyConnection(int port)
Starts the proxy on the port passed as parameter, or, if already used, on a free port. |
Method Summary | |
(package private) void |
launch()
Asks the thread manager to create minThreads threads. |
void |
run()
Waits for a connection and manages it until either the client or the server wants close it. |
(package private) void |
setAttributs(int maxThreads,
int minThreads,
int maxSpareThreads,
int minSpareThreads)
Changes the bounds for the number of threads. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static ThreadManager man
static java.net.ServerSocket serverSocket
java.net.Socket serverSideSocket
java.net.Socket clientSideSocket
java.io.InputStream clientSideIn
java.io.OutputStream clientSideOut
java.io.InputStream serverSideIn
java.io.OutputStream serverSideOut
boolean mustCloseConnection
Constructor Detail |
ProxyConnection()
ProxyConnection(int port) throws java.io.IOException
port
- the TCP port where waiting for connectionsMethod Detail |
void setAttributs(int maxThreads, int minThreads, int maxSpareThreads, int minSpareThreads) throws IllegalValuesException
maxThreads
- maximum number of existing ThreadsminThreads
- minimum number of existing ThreadsmaxSpareThreads
- maximum number of disactivated ThreadsminSpareThreads
- minimum number of disactivated ThreadsIllegalValuesException
- void launch() throws java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
IOException,
- InstantiationException, IllegalValuesExceptionpublic void run()
run
in interface java.lang.Runnable
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |