| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.netio.niowrapper
java.lang.Thread
|
+--com.newstep.solid.netio.niowrapper.SelectorThread
All Implemented Interfaces:
Runnable
public class SelectorThread
A thread that wraps a java.nio.channels.Selector and services selected keys.
getStartStopLatch MUST be invoked prior to starting this thread. The returned
CountDownLatch may be used to await for thread's startup.
Links:
Kernel Association Association Link
Associates type:
aggregation
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
associates:
com.newstep.solid.netio.niowrapper.SelectorListener
link:
aggregation
| Field Summary |
CountDownLatch |
|
protected final static String |
|
protected static Logger |
|
private boolean |
|
private Selector |
|
private CountDownLatch |
|
private ReentrantLock |
|
private ArrayList |
|
| Constructor Summary |
public void |
|
| Method Summary |
public void |
|
public void |
|
public CountDownLatch |
|
public void |
|
public void |
|
public void |
|
private void |
|
private void |
|
private void |
|
public void |
|
protected void |
updateKeys(SelectionKey sKey, Integer newInterest) |
protected final static String className
Final.
Multiplicity:
1
Static.
protected static Logger logger
Multiplicity:
1
Static.
private boolean running
Multiplicity:
1
private Selector selector
Multiplicity:
1
private CountDownLatch startStopLatch
Multiplicity:
1
CountDownLatch startStopLatch
private ReentrantLock taskLock
Multiplicity:
1
private ArrayList tasks
Multiplicity:
1
Custom properties
associates:
com.newstep.solid.netio.niowrapper.SelectorListener
public void SelectorThread (String name)
Stereotype:
create
public void addChannelInterest (SelectableChannel channel, Integer interest)
public void deregisterChannel (SelectableChannel channel)
public CountDownLatch getStartStopLatch ()
This operation MUST be invoked before starting the thread. The returned
latch can be used to await for the thread to start or exit after invoking
stopSelector method.
Return:
countDownLatch to await on while the trhead starts or exits
public void registerChannel (SelectableChannel channel, Integer interest, SelectorListener listener)
Throws:
IOException
public void removeChannelInterest (SelectableChannel channel, Integer interest)
public void run ()
scheduleChannelDeregistration
private void scheduleChannelDeregistration (SelectableChannel channel)
scheduleChannelRegistration
private void scheduleChannelRegistration (SelectableChannel channel, Integer interest, SelectorListener listener)
private void scheduleKeysUpdate (SelectionKey sKey, Integer newInterest)
public void stopSelector ()
protected void updateKeys (SelectionKey sKey, Integer newInterest)
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|