public class NioEndpoint.Poller extends Object implements Runnable
Constructor and Description |
---|
Poller() |
Modifier and Type | Method and Description |
---|---|
void |
add(NioChannel socket,
int interestOps)
Add specified socket and associated pool to the poller.
|
NioEndpoint.NioSocketWrapper |
cancelledKey(SelectionKey key) |
protected void |
destroy()
Destroy the poller.
|
boolean |
events()
Processes events in the event queue of the Poller.
|
int |
getKeyCount() |
Selector |
getSelector() |
protected void |
processKey(SelectionKey sk,
NioEndpoint.NioSocketWrapper attachment) |
SendfileState |
processSendfile(SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
boolean calledByProcessor) |
protected void |
reg(SelectionKey sk,
NioEndpoint.NioSocketWrapper attachment,
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(SelectionKey sk,
NioEndpoint.NioSocketWrapper attachment,
int readyOps) |
public Poller() throws IOException
IOException
public int getKeyCount()
public 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(SelectionKey key)
public void run()
protected void processKey(SelectionKey sk, NioEndpoint.NioSocketWrapper attachment)
public SendfileState processSendfile(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, boolean calledByProcessor)
protected void unreg(SelectionKey sk, NioEndpoint.NioSocketWrapper attachment, int readyOps)
protected void reg(SelectionKey sk, NioEndpoint.NioSocketWrapper attachment, int intops)
protected void timeout(int keyCount, boolean hasEvents)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.