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