|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.harness.logging.Listener
public class Listener
The generic listener listens to incoming requests and handles them appropriately.
Field Summary | |
---|---|
protected LogConfig |
config
The log configuration. |
protected Selector |
selector
The selector instance used for listening. |
Constructor Summary | |
---|---|
Listener(Selector selector,
LogConfig config,
Queue<SocketChannel> acceptQueue)
Constructs a new listener with this selector. |
Method Summary | |
---|---|
void |
acceptNewClient(SelectionKey key)
Accepts a new client and registers the resulting socket to the selector. |
void |
run()
The thread's run method. |
protected void |
selectorOps(Selector selector)
Hook for additional operations to be taken before the selector goes back to block on select. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Selector selector
protected LogConfig config
Constructor Detail |
---|
public Listener(Selector selector, LogConfig config, Queue<SocketChannel> acceptQueue)
selector
- The selectorconfig
- The log configurationacceptQueue
- The queue for accepted connectionsMethod Detail |
---|
public void run()
run
in interface Runnable
public void acceptNewClient(SelectionKey key) throws IOException
key
- The key result of the accept
IOException
- Error accepting new client
ClosedChannelException
- Client has already disconnectedprotected void selectorOps(Selector selector) throws IOException
selector
- The selector
IOException
- An I/O error occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |