Class HostSocketListener

  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:, 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
Field Summary
Fields inherited from class org.mortbay.util.ThreadPool
Fields inherited from interface org.mortbay.http.HttpListener
Constructor Summary
HostSocketListener(InetAddrPort address)
Method Summary
protected  void customizeRequest( 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

Constructor Detail


public HostSocketListener()


public HostSocketListener(InetAddrPort address)
Method Detail


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


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


protected void customizeRequest( 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.

customizeRequest in class SocketListener

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