public class NioEndpoint.Poller
extends java.lang.Object
implements java.lang.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(java.nio.channels.SelectionKey key) |
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 attachment) |
SendfileState |
processSendfile(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper socketWrapper,
boolean calledByProcessor) |
protected void |
reg(java.nio.channels.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(java.nio.channels.SelectionKey sk,
NioEndpoint.NioSocketWrapper attachment,
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 key)
public void run()
run
in interface java.lang.Runnable
protected void processKey(java.nio.channels.SelectionKey sk, NioEndpoint.NioSocketWrapper attachment)
public SendfileState processSendfile(java.nio.channels.SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, boolean calledByProcessor)
protected void unreg(java.nio.channels.SelectionKey sk, NioEndpoint.NioSocketWrapper attachment, int readyOps)
protected void reg(java.nio.channels.SelectionKey sk, NioEndpoint.NioSocketWrapper attachment, int intops)
protected void timeout(int keyCount, boolean hasEvents)
Copyright © 2000-1970 Apache Software Foundation. All Rights Reserved.