org.apache.tomcat.util.net
Class PoolTcpEndpoint
java.lang.Object
org.apache.tomcat.util.net.PoolTcpEndpoint
- All Implemented Interfaces:
- java.lang.Runnable
- public class PoolTcpEndpoint
- extends java.lang.Object
- implements java.lang.Runnable
Handle incoming TCP connections.
This class implement a simple server model: one listener thread accepts on a socket and
creates a new worker thread for each incoming connection.
More advanced Endpoints will reuse the threads, use queues, etc.
- Author:
- James Duncan Davidson [duncan@eng.sun.com], Jason Hunter [jch@eng.sun.com], James Todd [gonzo@eng.sun.com], Costin@eng.sun.com, Gal Shachor [shachor@il.ibm.com], Yoav Shapira
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tcpNoDelay
protected boolean tcpNoDelay
linger
protected int linger
socketTimeout
protected int socketTimeout
PoolTcpEndpoint
public PoolTcpEndpoint()
PoolTcpEndpoint
public PoolTcpEndpoint(ThreadPool tp)
setMaxThreads
public void setMaxThreads(int maxThreads)
getMaxThreads
public int getMaxThreads()
setMaxSpareThreads
public void setMaxSpareThreads(int maxThreads)
getMaxSpareThreads
public int getMaxSpareThreads()
setMinSpareThreads
public void setMinSpareThreads(int minThreads)
getMinSpareThreads
public int getMinSpareThreads()
setThreadPriority
public void setThreadPriority(int threadPriority)
getThreadPriority
public int getThreadPriority()
getPort
public int getPort()
setPort
public void setPort(int port)
getAddress
public java.net.InetAddress getAddress()
setAddress
public void setAddress(java.net.InetAddress inet)
setServerSocket
public void setServerSocket(java.net.ServerSocket ss)
setServerSocketFactory
public void setServerSocketFactory(ServerSocketFactory factory)
setConnectionHandler
public void setConnectionHandler(TcpConnectionHandler handler)
getConnectionHandler
public TcpConnectionHandler getConnectionHandler()
isRunning
public boolean isRunning()
isPaused
public boolean isPaused()
setBacklog
public void setBacklog(int backlog)
- Allows the server developer to specify the backlog that
should be used for server sockets. By default, this value
is 100.
getBacklog
public int getBacklog()
setServerTimeout
public void setServerTimeout(int timeout)
- Sets the timeout in ms of the server sockets created by this
server. This method allows the developer to make servers
more or less responsive to having their server sockets
shut down.
By default this value is 1000ms.
getTcpNoDelay
public boolean getTcpNoDelay()
setTcpNoDelay
public void setTcpNoDelay(boolean b)
getSoLinger
public int getSoLinger()
setSoLinger
public void setSoLinger(int i)
getSoTimeout
public int getSoTimeout()
setSoTimeout
public void setSoTimeout(int i)
getServerSoTimeout
public int getServerSoTimeout()
setServerSoTimeout
public void setServerSoTimeout(int i)
getStrategy
public java.lang.String getStrategy()
setStrategy
public void setStrategy(java.lang.String strategy)
getMaxHeaderCount
public int getMaxHeaderCount()
setMaxHeaderCount
public void setMaxHeaderCount(int maxHeaderCount)
getCurrentThreadCount
public int getCurrentThreadCount()
getCurrentThreadsBusy
public int getCurrentThreadsBusy()
initEndpoint
public void initEndpoint()
throws java.io.IOException,
java.lang.InstantiationException
- Throws:
java.io.IOException
java.lang.InstantiationException
startEndpoint
public void startEndpoint()
throws java.io.IOException,
java.lang.InstantiationException
- Throws:
java.io.IOException
java.lang.InstantiationException
pauseEndpoint
public void pauseEndpoint()
resumeEndpoint
public void resumeEndpoint()
stopEndpoint
public void stopEndpoint()
closeServerSocket
protected void closeServerSocket()
unlockAccept
protected void unlockAccept()
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-2012 Apache Software Foundation. All Rights Reserved.