equip.net
Class SimpleServer

java.lang.Object
  extended byequip.net.SimpleServer
All Implemented Interfaces:
java.lang.Runnable

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

A Simple Server class using a single ServerSapTcp access point, delegating request handling to an implementation of SimpleServerHandler


Nested Class Summary
protected  class SimpleServer.ClientThread
           
 
Field Summary
protected  java.lang.Object closure
           
protected  SimpleServerHandler handler
           
protected  SimpleMoniker moniker
           
protected  ServerSap serverSap
           
protected  java.lang.Object workerLock
           
 
Constructor Summary
SimpleServer()
           
 
Method Summary
 SimpleMoniker getMoniker()
          get server moniker
 boolean init(Moniker moniker_in, SimpleServerHandler handler)
          if you already know a moniker, e.g. from ServerURL; null closure
 boolean init(Moniker moniker_in, SimpleServerHandler handler, java.lang.Object closure)
          if you already know a moniker, e.g. from ServerURL
 boolean init(short port, SimpleServerHandler handler)
          if you know a port (even 0) but not a moniker; null closure
 boolean init(short port, SimpleServerHandler handler, java.lang.Object closure)
          if you know a port (even 0) but not a moniker
 void run()
           
 void shutdown()
          shut down server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moniker

protected SimpleMoniker moniker

serverSap

protected ServerSap serverSap

handler

protected SimpleServerHandler handler

closure

protected java.lang.Object closure

workerLock

protected java.lang.Object workerLock
Constructor Detail

SimpleServer

public SimpleServer()
Method Detail

init

public boolean init(Moniker moniker_in,
                    SimpleServerHandler handler)
if you already know a moniker, e.g. from ServerURL; null closure


init

public boolean init(Moniker moniker_in,
                    SimpleServerHandler handler,
                    java.lang.Object closure)
if you already know a moniker, e.g. from ServerURL


init

public boolean init(short port,
                    SimpleServerHandler handler)
if you know a port (even 0) but not a moniker; null closure


init

public boolean init(short port,
                    SimpleServerHandler handler,
                    java.lang.Object closure)
if you know a port (even 0) but not a moniker


shutdown

public void shutdown()
shut down server


getMoniker

public SimpleMoniker getMoniker()
get server moniker


run

public void run()
Specified by:
run in interface java.lang.Runnable