org.apache.tomcat.util.net
Class JIoEndpoint.Poller

java.lang.Object
  extended by org.apache.tomcat.util.net.JIoEndpoint.Poller
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
JIoEndpoint

public class JIoEndpoint.Poller
extends java.lang.Object
implements java.lang.Runnable

Poller class.


Field Summary
protected  JIoEndpoint.SocketList addList
          List of sockets to be added to the poller.
protected  int connectionCount
          Amount of connections inside this poller.
protected  long lastMaintain
          Last run of maintain.
protected  JIoEndpoint.SocketList localAddList
          List of sockets to be added to the poller.
protected  JIoEndpoint.SocketTimeouts timeouts
          Structure used for storing timeouts.
 
Constructor Summary
JIoEndpoint.Poller()
           
 
Method Summary
 void add(java.net.Socket socket, int timeout, boolean resume, boolean wakeup)
          Add specified socket and associated pool to the poller.
protected  void destroy()
          Destroy the poller.
 int getConnectionCount()
           
protected  void init()
          Create the poller.
protected  void maintain()
          Timeout checks.
 void run()
          The background thread that listens for incoming TCP/IP connections and hands them off to an appropriate processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addList

protected JIoEndpoint.SocketList addList
List of sockets to be added to the poller.


localAddList

protected JIoEndpoint.SocketList localAddList
List of sockets to be added to the poller.


timeouts

protected JIoEndpoint.SocketTimeouts timeouts
Structure used for storing timeouts.


lastMaintain

protected long lastMaintain
Last run of maintain. Maintain will run usually every 5s.


connectionCount

protected int connectionCount
Amount of connections inside this poller.

Constructor Detail

JIoEndpoint.Poller

public JIoEndpoint.Poller()
Method Detail

getConnectionCount

public int getConnectionCount()

init

protected void init()
Create the poller. The java.io poller only deals with timeouts.


destroy

protected void destroy()
Destroy the poller.


add

public void add(java.net.Socket socket,
                int timeout,
                boolean resume,
                boolean wakeup)
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:
socket - to add to the poller

maintain

protected void maintain()
Timeout checks.


run

public void run()
The background thread that listens for incoming TCP/IP connections and hands them off to an appropriate processor.

Specified by:
run in interface java.lang.Runnable


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.