org.apache.tomcat.util.net
public class NioEndpoint.Poller extends java.lang.Object implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected boolean |
close |
protected java.util.concurrent.ConcurrentLinkedQueue<java.lang.Runnable> |
events |
protected long |
nextExpiration |
protected java.nio.channels.Selector |
selector |
protected java.util.concurrent.CountDownLatch |
stopLatch |
protected java.util.concurrent.atomic.AtomicLong |
wakeupCounter |
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 |
addEvent(java.lang.Runnable event) |
void |
cancelledKey(java.nio.channels.SelectionKey key,
SocketStatus status,
boolean dispatch) |
void |
cometInterest(NioChannel socket) |
protected void |
destroy()
Destroy the poller.
|
boolean |
events() |
java.nio.channels.Selector |
getSelector() |
protected boolean |
processKey(java.nio.channels.SelectionKey sk,
NioEndpoint.KeyAttachment attachment) |
boolean |
processSendfile(java.nio.channels.SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
boolean reg,
boolean event) |
protected void |
reg(java.nio.channels.SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
int intops) |
void |
register(NioChannel socket) |
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(java.nio.channels.SelectionKey sk,
NioEndpoint.KeyAttachment attachment,
int readyOps) |
void |
wakeup() |
protected java.nio.channels.Selector selector
protected java.util.concurrent.ConcurrentLinkedQueue<java.lang.Runnable> events
protected volatile boolean close
protected long nextExpiration
protected java.util.concurrent.atomic.AtomicLong wakeupCounter
protected java.util.concurrent.CountDownLatch stopLatch
public NioEndpoint.Poller() throws java.io.IOException
java.io.IOException
public java.nio.channels.Selector getSelector()
protected void destroy()
public void addEvent(java.lang.Runnable event)
public void cometInterest(NioChannel socket)
public void wakeup()
public void add(NioChannel socket)
socket
- to add to the pollerpublic void add(NioChannel socket, int interestOps)
public boolean events()
public void register(NioChannel socket)
public void cancelledKey(java.nio.channels.SelectionKey key, SocketStatus status, boolean dispatch)
public void run()
run
in interface java.lang.Runnable
protected boolean processKey(java.nio.channels.SelectionKey sk, NioEndpoint.KeyAttachment attachment)
public boolean processSendfile(java.nio.channels.SelectionKey sk, NioEndpoint.KeyAttachment attachment, boolean reg, boolean event)
protected void unreg(java.nio.channels.SelectionKey sk, NioEndpoint.KeyAttachment attachment, int readyOps)
protected void reg(java.nio.channels.SelectionKey sk, NioEndpoint.KeyAttachment attachment, int intops)
protected void timeout(int keyCount, boolean hasEvents)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.