Class NioEndpoint.Poller
java.lang.Object
org.apache.tomcat.util.net.NioEndpoint.Poller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(NioEndpoint.NioSocketWrapper socketWrapper, int interestOps) Add specified socket and associated pool to the poller.voidcancelledKey(SelectionKey sk, SocketWrapperBase<NioChannel> socketWrapper) protected voiddestroy()Destroy the poller.booleanevents()Processes events in the event queue of the Poller.intprotected voidprocessKey(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper) processSendfile(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, boolean calledByProcessor) protected voidreg(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, int intops) voidregister(NioEndpoint.NioSocketWrapper socketWrapper) Registers a newly created socket with the poller.voidrun()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 voidtimeout(int keyCount, boolean hasEvents) protected voidunreg(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, int readyOps)
-
Constructor Details
-
Poller
- Throws:
IOException
-
-
Method Details
-
getKeyCount
public int getKeyCount() -
getSelector
-
destroy
protected void destroy()Destroy the poller. -
add
Add specified socket and associated pool to the poller. The socket will be added to a temporary array, and polled first after a maximum amount of time equal to pollTime (in most cases, latency will be much lower, however).- Parameters:
socketWrapper- to add to the pollerinterestOps- Operations for which to register this socket with the Poller
-
events
public boolean events()Processes events in the event queue of the Poller.- Returns:
trueif some events were processed,falseif queue was empty
-
register
Registers a newly created socket with the poller.- Parameters:
socketWrapper- The socket wrapper
-
cancelledKey
-
run
-
processKey
-
processSendfile
public SendfileState processSendfile(SelectionKey sk, NioEndpoint.NioSocketWrapper socketWrapper, boolean calledByProcessor) -
unreg
-
reg
-
timeout
protected void timeout(int keyCount, boolean hasEvents)
-