|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.msi.network.server.TCPServer
TCPServer implements a multi-threaded ServerSocket based server. At this level the server instantiates a server socket and starts a low-level server to handle the protocol of the server itself.
Successful operation requires that the RHFactory have a registered RHBuilder for the port this thread will service.
| Field Summary | |
private boolean |
isSSL
isSSL indicates/controls whether this
is an SSL (secure) or non-SSL server. |
protected java.lang.Thread |
kicker
kicker - thread management. |
protected int |
maxServers
maxServers - maximum before holding off on requests |
private boolean |
onLine
|
protected int |
port
port - for the interface. |
protected TCPInterface |
TCPif
TCPif - communications channel to client. |
| Fields inherited from interface com.msi.network.server.ServerConstants |
defaultMaxServers, serverSamplePeriod |
| Constructor Summary | |
private |
TCPServer()
Creates a new TCPServer instance. |
|
TCPServer(int port)
Set up the internal state. |
|
TCPServer(int port,
boolean isSSL)
Creates a new TCPServer instance. |
|
TCPServer(int port,
int maxServers)
Creates a new TCPServer instance. |
|
TCPServer(int port,
int maxServers,
boolean isSSL)
Creates a new TCPServer instance. |
|
TCPServer(int port,
int maxServers,
long connTO)
Creates a new TCPServer instance. |
|
TCPServer(int port,
int maxServers,
long connTO,
boolean isSSL)
Creates a new TCPServer instance. |
| Method Summary | |
protected void |
finalize()
Describe finalize method here. |
int |
getMaxServers()
Get the value of maxServers. |
boolean |
isIsSSL()
Get the value of isSSL. |
boolean |
isOnLine()
Return the current value of the onLine status. |
void |
run()
Main control loop of the thread, calls runServer to perform the actual server operations. |
void |
runServer(Connection conn)
Create a new requestHandler thread passing the connection and start the thread. |
void |
setIsSSL(boolean v)
Set the value of isSSL. |
void |
setMaxServers(int v)
Set the value of maxServers. |
void |
setOnLine(boolean v)
Set the value of the online status. |
void |
start()
Spawn a thread if needed and open the server socket. |
java.lang.String |
statsString()
statsString - present the current state as a String. |
void |
stop()
Cleanup and shutdown. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean isSSL
isSSL indicates/controls whether this
is an SSL (secure) or non-SSL server.
protected int maxServers
maxServers - maximum before holding off on requests
protected TCPInterface TCPif
TCPif - communications channel to client.
protected int port
port - for the interface.
protected java.lang.Thread kicker
kicker - thread management.
private boolean onLine
| Constructor Detail |
private TCPServer()
TCPServer instance.
public TCPServer(int port)
port - TCP/IP port for communication with the client.
public TCPServer(int port,
boolean isSSL)
TCPServer instance.
port - an int valueisSSL - a boolean value
public TCPServer(int port,
int maxServers)
TCPServer instance.
Set up the internal state. Actual startup requires
that the instantiating code call the start() method.
port - an int valuemaxServers - an int value
public TCPServer(int port,
int maxServers,
boolean isSSL)
TCPServer instance.
port - an int valuemaxServers - an int valueisSSL - a boolean value
public TCPServer(int port,
int maxServers,
long connTO)
TCPServer instance.
Set up the internal state. Actual startup requires
that the instantiating code call the start() method.
port - an int valuemaxServers - an int valueconnTO - over-ride the default connection TimeOut.
public TCPServer(int port,
int maxServers,
long connTO,
boolean isSSL)
TCPServer instance.
port - an int valuemaxServers - an int valueconnTO - a long valueisSSL - a boolean value| Method Detail |
public void runServer(Connection conn)
May be over-ridden in the subclass to provide the server functionality when either single-threading or exceptional operation is required.
conn - a Connection valuepublic void start()
public void stop()
protected void finalize()
finalize method here.
public void run()
run in interface java.lang.Runnablepublic java.lang.String statsString()
statsString - present the current state as a String.
String representation of interface state.public boolean isOnLine()
public void setOnLine(boolean v)
v - new value for the online status.public int getMaxServers()
public void setMaxServers(int v)
v - Value to assign to maxServers.public boolean isIsSSL()
public void setIsSSL(boolean v)
v - Value to assign to isSSL.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||