public class NioEndpoint.Poller extends Object implements Runnable
Constructor and Description |
---|
NioEndpoint.Poller() |
Modifier and Type | Method and Description |
---|---|
void |
add(NioChannel socket)
Add specified socket and associated pool to the poller.
|
void |
add(NioChannel socket,
int interestOps) |
void |
cancelledKey(SelectionKey key,
SocketStatus status) |
protected void |
destroy()
Destroy the poller.
|
boolean |
events()
Processes events in the event queue of the Poller.
|
int |
getKeyCount() |
Selector |
getSelector() |
protected boolean |
processKey(SelectionKey sk,
NioEndpoint.KeyAttachment attachment) |
boolean |
processSendfile(SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
boolean event) |
protected void |
reg(SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
int intops) |
void |
register(NioChannel socket)
Registers a newly created socket with the poller.
|
void |
run()
The background thread that listens for incoming TCP/IP connections and
hands them off to an appropriate processor.
|
protected void |
timeout(int keyCount,
boolean hasEvents) |
protected void |
unreg(SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
int readyOps) |
public NioEndpoint.Poller() throws IOException
IOException
public int getKeyCount()
public Selector getSelector()
protected void destroy()
public void add(NioChannel socket)
socket
- to add to the pollerpublic void add(NioChannel socket, int interestOps)
public boolean events()
true
if some events were processed,
false
if queue was emptypublic void register(NioChannel socket)
socket
- The newly created socketpublic void cancelledKey(SelectionKey key, SocketStatus status)
public void run()
protected boolean processKey(SelectionKey sk, NioEndpoint.KeyAttachment attachment)
public boolean processSendfile(SelectionKey sk, NioEndpoint.KeyAttachment attachment, boolean event)
protected void unreg(SelectionKey sk, NioEndpoint.KeyAttachment attachment, int readyOps)
protected void reg(SelectionKey sk, NioEndpoint.KeyAttachment attachment, int intops)
protected void timeout(int keyCount, boolean hasEvents)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.