java.lang.Runnablepublic class NioEndpoint.Poller
extends java.lang.Object
implements java.lang.Runnable
| Constructor | Description |
|---|---|
Poller() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(NioChannel socket,
int interestOps) |
Add specified socket and associated pool to the poller.
|
NioEndpoint.NioSocketWrapper |
cancelledKey(java.nio.channels.SelectionKey sk) |
|
protected void |
destroy() |
Destroy the poller.
|
boolean |
events() |
Processes events in the event queue of the Poller.
|
int |
getKeyCount() |
|
java.nio.channels.Selector |
getSelector() |
|
protected void |
processKey(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper) |
|
SendfileState |
processSendfile(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
boolean calledByProcessor) |
|
protected void |
reg(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
int intops) |
|
void |
register(NioChannel socket) |
Registers a newly created socket with the poller.
|
void |
run() |
The background thread that adds sockets to the Poller, checks the
poller for triggered events and hands the associated socket off to an
appropriate processor as events occur.
|
protected void |
timeout(int keyCount,
boolean hasEvents) |
|
protected void |
unreg(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
int readyOps) |
public int getKeyCount()
public java.nio.channels.Selector getSelector()
protected void destroy()
public void add(NioChannel socket, int interestOps)
socket - to add to the pollerinterestOps - Operations for which to register this socket with
the Pollerpublic boolean events()
true if some events were processed,
false if queue was emptypublic void register(NioChannel socket)
socket - The newly created socketpublic NioEndpoint.NioSocketWrapper cancelledKey(java.nio.channels.SelectionKey sk)
public void run()
run in interface java.lang.Runnableprotected void processKey(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper)
public SendfileState processSendfile(java.nio.channels.SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, boolean calledByProcessor)
protected void unreg(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
int readyOps)
protected void reg(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
int intops)
protected void timeout(int keyCount,
boolean hasEvents)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.