org.mortbay.http
Class HostSocketListener

java.lang.Object
  extended by org.mortbay.util.ThreadPool
      extended by org.mortbay.util.ThreadedServer
          extended by org.mortbay.http.SocketListener
              extended by org.mortbay.http.HostSocketListener
All Implemented Interfaces:
java.io.Serializable, HttpListener, LifeCycle

public class HostSocketListener
extends SocketListener

Forced Host Listener this simple listener extention forces the host header to be set to a specific value. It is useful when deployed behind old apache mod_proxy implementations that lie about the real host used by the client.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mortbay.util.ThreadPool
ThreadPool.PoolThread
 
Field Summary
 
Fields inherited from class org.mortbay.util.ThreadPool
__DAEMON, __PRIORITY
 
Fields inherited from interface org.mortbay.http.HttpListener
ATTRIBUTE
 
Constructor Summary
HostSocketListener()
           
HostSocketListener(InetAddrPort address)
           
 
Method Summary
protected  void customizeRequest(java.net.Socket socket, HttpRequest request)
          Customize request from socket.
 java.lang.String getForcedHost()
           
 void setForcedHost(java.lang.String host)
           
 
Methods inherited from class org.mortbay.http.SocketListener
createConnection, customizeRequest, getBufferReserve, getBufferSize, getConfidentialPort, getConfidentialScheme, getDefaultScheme, getHttpHandler, getHttpServer, getIdentifyListener, getIntegralPort, getIntegralScheme, getLowResourcePersistTimeMs, getLowResources, handleConnection, isConfidential, isIntegral, isLowOnResources, isOutOfResources, persistConnection, setBufferReserve, setBufferSize, setConfidentialPort, setConfidentialScheme, setDefaultScheme, setHttpHandler, setHttpServer, setIdentifyListener, setIntegralPort, setIntegralScheme, setLowResourcePersistTimeMs, setLowResources, start, stop
 
Methods inherited from class org.mortbay.util.ThreadedServer
acceptSocket, acceptSocket, getAcceptorThreads, getAcceptQueueSize, getHost, getInetAddress, getInetAddrPort, getLingerTimeSecs, getMaxReadTimeMs, getPort, getServerSocket, getTcpNoDelay, handle, handleConnection, newServerSocket, open, setAcceptorThreads, setAcceptQueueSize, setHost, setInetAddress, setInetAddrPort, setLingerTimeSecs, setMaxReadTimeMs, setPort, setTcpNoDelay, stopJob, toString
 
Methods inherited from class org.mortbay.util.ThreadPool
getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.http.HttpListener
getHost, getPort, setHost, setPort
 
Methods inherited from interface org.mortbay.util.LifeCycle
isStarted
 

Constructor Detail

HostSocketListener

public HostSocketListener()

HostSocketListener

public HostSocketListener(InetAddrPort address)
Method Detail

getForcedHost

public java.lang.String getForcedHost()
Returns:
Returns the host.

setForcedHost

public void setForcedHost(java.lang.String host)
Parameters:
host - The host to set.

customizeRequest

protected void customizeRequest(java.net.Socket socket,
                                HttpRequest request)
Description copied from class: SocketListener
Customize request from socket. Derived versions of SocketListener may specialize this method to customize the request with attributes of the socket used (eg SSL session ids). This version resets the SoTimeout if it has been reduced due to low resources. Derived implementations should call super.customizeRequest(socket,request) unless persistConnection has also been overridden and not called.

Overrides:
customizeRequest in class SocketListener


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.