|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IOReactor
HttpCore NIO is based on the Reactor pattern as described by Doug Lea. The purpose of I/O reactors is to react to I/O events and to dispatch event notifications to individual I/O sessions. The main idea of I/O reactor pattern is to break away from the one thread per connection model imposed by the classic blocking I/O model.
The IOReactor interface represents an abstract object implementing the Reactor pattern.
I/O reactors usually employ a small number of dispatch threads (often as few as one) to dispatch I/O event notifications to a much greater number (often as many as several thousands) of I/O sessions or connections. It is generally recommended to have one dispatch thread per CPU core.
Method Summary | |
---|---|
void |
execute(IOEventDispatch eventDispatch)
Starts the reactor and initiates the dispatch of I/O event notifications to the given IOEventDispatch . |
IOReactorStatus |
getStatus()
Returns the current status of the reactor. |
void |
shutdown()
Initiates shutdown of the reactor and blocks for a default period of time waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds. |
void |
shutdown(long waitMs)
Initiates shutdown of the reactor and blocks approximately for the given period of time in milliseconds waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds. |
Method Detail |
---|
IOReactorStatus getStatus()
void execute(IOEventDispatch eventDispatch) throws IOException
IOEventDispatch
.
eventDispatch
- the I/O event dispatch.
IOException
- in case of an I/O error.void shutdown(long waitMs) throws IOException
waitMs
- wait time in milliseconds.
IOException
- in case of an I/O error.void shutdown() throws IOException
IOException
- in case of an I/O error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |