|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectseda.sandStorm.lib.http.httpServer
public class httpServer
An httpServer is a SandStorm stage which accepts incoming HTTP connections. The server has a client sink associated with it, onto which httpConnection and httpRequest events are pushed. When a connection is closed, a SinkClosedEvent is pushed, with the sink pointer set to the httpConnection that closed.
httpConnection,
httpRequest| Field Summary | |
|---|---|
protected SinkIF |
clientSink
|
private java.util.Hashtable |
connTable
|
private static boolean |
DEBUG
|
protected int |
listenPort
|
protected ManagerIF |
mgr
|
protected SinkIF |
mySink
|
private static int |
num_svrs
|
protected ATcpServerSocket |
servsock
|
| Fields inherited from interface seda.sandStorm.lib.http.httpConst |
|---|
CRLF, DEFAULT_HTTP_PORT, HTTP_VERSION, WRITE_CLOG_THRESHOLD |
| Constructor Summary | |
|---|---|
httpServer(ManagerIF mgr,
SinkIF clientSink)
Create an HTTP server listening for incoming connections on the default port of 8080. |
|
httpServer(ManagerIF mgr,
SinkIF clientSink,
int listenPort)
Create an HTTP server listening for incoming connections on the given listenPort. |
|
| Method Summary | |
|---|---|
(package private) void |
cleanupConnection(httpConnection hc)
|
void |
destroy()
The Sandstorm stage destroy method. |
ATcpServerSocket |
getServerSocket()
Return the server socket being used by this httpServer. |
(package private) SinkIF |
getSink()
|
void |
handleEvent(QueueElementIF qel)
The main event handler. |
void |
handleEvents(QueueElementIF[] qelarr)
Handle the events corresponding to the given QueueElementIF array. |
void |
init(ConfigDataIF config)
The Sandstorm stage initialization method. |
void |
registerSink(SinkIF sink)
Register a sink to receive incoming packets on this connection. |
void |
resumeAccept()
Resume acceptance of new connections on this server. |
void |
suspendAccept()
Suspend acceptance of new connections on this server. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
protected int listenPort
protected ATcpServerSocket servsock
protected ManagerIF mgr
protected SinkIF mySink
protected SinkIF clientSink
private java.util.Hashtable connTable
private static int num_svrs
| Constructor Detail |
|---|
public httpServer(ManagerIF mgr,
SinkIF clientSink)
throws java.lang.Exception
java.lang.Exception
public httpServer(ManagerIF mgr,
SinkIF clientSink,
int listenPort)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public void init(ConfigDataIF config)
throws java.lang.Exception
init in interface EventHandlerIFconfig - The set of configuration parameters for the stage.
java.lang.Exception - The EventHandler can indicate an
error to the runtime during initialization by throwing an
Exception.public void destroy()
destroy in interface EventHandlerIFpublic void handleEvent(QueueElementIF qel)
handleEvent in interface EventHandlerIFpublic void handleEvents(QueueElementIF[] qelarr)
EventHandlerIF
handleEvents in interface EventHandlerIFvoid cleanupConnection(httpConnection hc)
public java.lang.String toString()
toString in class java.lang.Objectpublic void registerSink(SinkIF sink)
public void suspendAccept()
public void resumeAccept()
SinkIF getSink()
public ATcpServerSocket getServerSocket()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||