com.sun.faban.harness.logging
Class PrimaryListener
java.lang.Object
com.sun.faban.harness.logging.Listener
com.sun.faban.harness.logging.PrimaryListener
- All Implemented Interfaces:
- Runnable
public class PrimaryListener
- extends Listener
The primary selector is the single entry point another thread may use
to modify the select channels and configurations. Otherwise it behaves
just like any other listener.
- Author:
- Akara Sucharitakul
Method Summary |
void |
register(SelectableChannel channel,
int operation,
Object attachment)
Adds/changes the channel registration from another thread. |
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 |
PrimaryListener
public PrimaryListener(Selector selector,
LogConfig config,
Queue<SocketChannel> acceptQueue)
- Constructs the primary listener with this selector.
- Parameters:
selector
- The selectorconfig
- The log configurationacceptQueue
- The accept queue
selectorOps
protected void selectorOps(Selector selector)
throws IOException
- Hook for additional operations to be taken before the selector goes
back to block on select. All changes to the channels/keys should
be called here. The implementation in this class logs changes to
the channel.
- Overrides:
selectorOps
in class Listener
- Parameters:
selector
- The selector
- Throws:
IOException
- Error registering the selector with the channel
register
public void register(SelectableChannel channel,
int operation,
Object attachment)
- Adds/changes the channel registration from another thread.
- Parameters:
channel
- The channel to registeroperation
- The operation of interestattachment
- The attachment