com.objectwave.simpleSockets
Class SimpleServer

java.lang.Object
  |
  +--com.objectwave.simpleSockets.SimpleServer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Gateway, ObjectServer, SimpleHTTP, WatchdogServer

public class SimpleServer
extends java.lang.Object
implements java.lang.Runnable

A Server shell for providing multithreaded application servers.

Version:
$Id: SimpleServer.java,v 2.0 2001/06/11 15:46:53 dave_hoag Exp $
Author:
dhoag

Field Summary
static int count
           
 
Constructor Summary
SimpleServer()
           
 
Method Summary
protected  void errorlog(java.lang.String aString)
           
 ServeClient getClientServer(SimpleServer svr, int count)
          Override this method if you don't want to do anything special with the handling of clients.
 ServeClient getClientServer(SimpleServer svr, int count, java.lang.Thread t)
           
protected  int getClientThreadPriority()
          Gets the ClientThreadPriority attribute of the SimpleServer object
 void handleConnection(java.net.Socket newSocket)
          handleConnection: Key method for starting server clients.
static void main(java.lang.String[] args)
          This method should be overriden to create an instance of your SimpleServer.
 void port(int port)
          Change the default port of 3000 to the value provided by the parameter.
 void run()
          Just loop and listen for client requests.
 void startServer()
          Start up the socket server.
 void startThread(java.lang.Runnable r)
          Use the thread pool to start a thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

public static int count
Constructor Detail

SimpleServer

public SimpleServer()
Method Detail

main

public static void main(java.lang.String[] args)
This method should be overriden to create an instance of your SimpleServer. It should look the same xcept it should Specify new .startServer();

Parameters:
args -

getClientServer

public ServeClient getClientServer(SimpleServer svr,
                                   int count)
Override this method if you don't want to do anything special with the handling of clients. Just return your ServerClient object.

Parameters:
svr -
count -
Returns:
The ClientServer value

getClientServer

public ServeClient getClientServer(SimpleServer svr,
                                   int count,
                                   java.lang.Thread t)
Parameters:
svr -
count -
t -
Returns:
The ClientServer value

handleConnection

public void handleConnection(java.net.Socket newSocket)
handleConnection: Key method for starting server clients.

Parameters:
newSocket -

startThread

public void startThread(java.lang.Runnable r)
Use the thread pool to start a thread.

Parameters:
r -

port

public void port(int port)
Change the default port of 3000 to the value provided by the parameter.

Parameters:
port -

run

public void run()
Just loop and listen for client requests.

Specified by:
run in interface java.lang.Runnable

startServer

public void startServer()
Start up the socket server.


getClientThreadPriority

protected int getClientThreadPriority()
Gets the ClientThreadPriority attribute of the SimpleServer object

Returns:
The ClientThreadPriority value

errorlog

protected void errorlog(java.lang.String aString)
Parameters:
aString -