|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.awf.io.IOLoop
public class IOLoop
| Field Summary | |
|---|---|
static IOLoop |
INSTANCE
|
| Constructor Summary | |
|---|---|
IOLoop()
|
|
| Method Summary | |
|---|---|
void |
addCallback(AsyncCallback callback)
The callback will be invoked in the next iteration in the io loop. |
SelectionKey |
addHandler(SelectableChannel channel,
IOHandler handler,
int interestOps,
Object attachment)
Registers a new IOHandler with this IOLoop. |
void |
addKeepAliveTimeout(SelectableChannel channel,
Timeout keepAliveTimeout)
|
void |
addTimeout(Timeout timeout)
|
int |
getNumberOfRegisteredIOHandlers()
|
List<String> |
getRegisteredIOHandlers()
|
boolean |
hasKeepAliveTimeout(SelectableChannel channel)
|
boolean |
isRunning()
Checks whether this IOLoop is running or not. |
void |
removeHandler(SelectableChannel channel)
Unregisters the previously registered IOHandler. |
void |
start()
Start the io loop. |
void |
stop()
Stop the io loop and release the thread (io loop thread) that invoked the start() method. |
void |
updateHandler(SelectableChannel channel,
int newInterestOps)
Update an earlier registered SelectableChannel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final IOLoop INSTANCE
| Constructor Detail |
|---|
public IOLoop()
| Method Detail |
|---|
public void start()
stop() is invoked) and will be the io loop thread.
public void stop()
start() method.
public SelectionKey addHandler(SelectableChannel channel,
IOHandler handler,
int interestOps,
Object attachment)
IOHandler with this IOLoop.
channel - The SelectableChannelhandler - IOHandler that will receive the io callbacks.interestOps - See SelectionKey for valid values. (Xor for
multiple interests).attachment - The attachment that will be accessible from the
returning SelectionKeys attachment.public void removeHandler(SelectableChannel channel)
IOHandler.
channel - The SelectableChannel that was registered with a
user defined IOHandler
public void updateHandler(SelectableChannel channel,
int newInterestOps)
SelectableChannel
channel - The SelectableChannelnewInterestOps - The complete new set of interest operations.
public void addKeepAliveTimeout(SelectableChannel channel,
Timeout keepAliveTimeout)
public boolean hasKeepAliveTimeout(SelectableChannel channel)
public void addTimeout(Timeout timeout)
public void addCallback(AsyncCallback callback)
public int getNumberOfRegisteredIOHandlers()
getNumberOfRegisteredIOHandlers in interface IOLoopMXBeanpublic List<String> getRegisteredIOHandlers()
getRegisteredIOHandlers in interface IOLoopMXBeanpublic boolean isRunning()
true if running; false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||