org.apache.tomcat.util.net
Class PoolTcpEndpoint

java.lang.Object
  extended byorg.apache.tomcat.util.net.PoolTcpEndpoint

public class PoolTcpEndpoint
extends java.lang.Object

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]

Field Summary
protected  int linger
           
protected  int socketTimeout
           
protected  boolean tcpNoDelay
           
 
Constructor Summary
PoolTcpEndpoint()
           
PoolTcpEndpoint(ThreadPool tp)
           
 
Method Summary
protected  void closeServerSocket()
           
 java.net.InetAddress getAddress()
           
 int getBacklog()
           
 TcpConnectionHandler getConnectionHandler()
           
 int getMaxSpareThreads()
           
 int getMaxThreads()
           
 int getMinSpareThreads()
           
 int getPort()
           
 int getServerSoTimeout()
           
 int getSoLinger()
           
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 void initEndpoint()
           
 boolean isPoolOn()
           
 boolean isRunning()
           
 void log(java.lang.String msg)
          Deprecated.  
 void log(java.lang.String msg, int level)
          Deprecated.  
 void log(java.lang.String msg, java.lang.Throwable t)
          Deprecated.  
 void log(java.lang.String msg, java.lang.Throwable t, int level)
          Deprecated.  
 void setAddress(java.net.InetAddress inet)
           
 void setBacklog(int backlog)
          Allows the server developer to specify the backlog that should be used for server sockets.
 void setConnectionHandler(TcpConnectionHandler handler)
           
 void setMaxSpareThreads(int maxThreads)
           
 void setMaxThreads(int maxThreads)
           
 void setMinSpareThreads(int minThreads)
           
 void setPoolOn(boolean isPool)
           
 void setPort(int port)
           
 void setServerSocket(java.net.ServerSocket ss)
           
 void setServerSocketFactory(ServerSocketFactory factory)
           
 void setServerSoTimeout(int i)
           
 void setServerTimeout(int timeout)
          Sets the timeout in ms of the server sockets created by this server.
 void setSoLinger(int i)
           
 void setSoTimeout(int i)
           
 void setTcpNoDelay(boolean b)
           
 void startEndpoint()
           
 void stopEndpoint()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tcpNoDelay

protected boolean tcpNoDelay

linger

protected int linger

socketTimeout

protected int socketTimeout
Constructor Detail

PoolTcpEndpoint

public PoolTcpEndpoint()

PoolTcpEndpoint

public PoolTcpEndpoint(ThreadPool tp)
Method Detail

setPoolOn

public void setPoolOn(boolean isPool)

isPoolOn

public boolean isPoolOn()

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()

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()

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)

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

stopEndpoint

public void stopEndpoint()

closeServerSocket

protected void closeServerSocket()

log

public void log(java.lang.String msg)
Deprecated.  


log

public void log(java.lang.String msg,
                java.lang.Throwable t)
Deprecated.  


log

public void log(java.lang.String msg,
                int level)
Deprecated.  


log

public void log(java.lang.String msg,
                java.lang.Throwable t,
                int level)
Deprecated.  



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