|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.berkeley.psi.seda.generic.genericServer
public class genericServer
A genericServer is an EventHandlerIF for a SandStorm stage which accepts incoming service connections. The server has a client sink associated with it, onto which genericConnection and genericRequest events are pushed. When a connection is closed, a SinkClosedEvent is pushed, with the sink pointer set to the genericConnection that closed.
genericConnection
,
genericRequest
Field Summary | |
---|---|
private static boolean |
DEBUG
|
protected int |
listenPort
|
protected ManagerIF |
mgr
|
protected SinkIF |
mySink
|
private static int |
num_svrs
|
protected ATcpServerSocket |
servsock
|
protected StageIF |
stage
|
Fields inherited from interface edu.berkeley.psi.seda.generic.genericConst |
---|
CRLF, DEFAULT_PORT, WRITE_CLOG_THRESHOLD |
Constructor Summary | |
---|---|
genericServer()
Create a generic server listening for incoming connections on the default port. |
Method Summary | |
---|---|
void |
destroy()
Called when an event handler is destroyed. |
ATcpServerSocket |
getServerSocket()
Return the server socket being used by this genericServer. |
(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 |
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
private static int num_svrs
protected int listenPort
protected ATcpServerSocket servsock
protected ManagerIF mgr
protected StageIF stage
protected SinkIF mySink
Constructor Detail |
---|
public genericServer()
Method Detail |
---|
public void init(ConfigDataIF config) throws java.lang.Exception
init
in interface EventHandlerIF
config
- 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()
EventHandlerIF
destroy
in interface EventHandlerIF
public void handleEvent(QueueElementIF qel)
handleEvent
in interface EventHandlerIF
public void handleEvents(QueueElementIF[] qelarr)
EventHandlerIF
handleEvents
in interface EventHandlerIF
public java.lang.String toString()
toString
in class java.lang.Object
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 |