org.mortbay.http.ajp
Class AJP13Connection

java.lang.Object
  extended by org.mortbay.http.HttpConnection
      extended by org.mortbay.http.ajp.AJP13Connection
All Implemented Interfaces:
OutputObserver

public class AJP13Connection
extends HttpConnection

Version:
$Id: AJP13Connection.java,v 1.39 2007/03/05 00:15:05 janb Exp $
Author:
Greg Wilkins (gregw)

Field Summary
 
Fields inherited from class org.mortbay.http.HttpConnection
_dotVersion, _keepAlive, _persistent, _request, _response
 
Fields inherited from interface org.mortbay.util.OutputObserver
__CLOSED, __CLOSING, __COMMITING, __FIRST_WRITE, __RESET_BUFFER
 
Constructor Summary
AJP13Connection(AJP13Listener listener, java.io.InputStream in, java.io.OutputStream out, java.net.Socket socket, int bufferSize)
           
 
Method Summary
protected  void commit()
           
 void destroy()
          Destroy the connection.
protected  void firstWrite()
          Setup the reponse output stream.
 java.lang.String getDefaultScheme()
          Get the listeners Default scheme.
 java.lang.String getRemoteAddr()
          Get the Remote address.
 java.lang.String getRemoteHost()
          Get the Remote address.
 java.net.InetAddress getRemoteInetAddress()
          Get the Remote address.
 java.lang.String getServerName()
          Get the listeners HttpServer .
 int getServerPort()
          Get the listeners Port .
 boolean handleNext()
          Handle next request off the connection.
 boolean isSSL()
           
protected  void setupOutputStream()
           
 
Methods inherited from class org.mortbay.http.HttpConnection
associateThread, close, disassociateThread, forceClose, getConnection, getHttpServer, getHttpTunnel, getInputStream, getListener, getObject, getOutputStream, getRemotePort, getRequest, getResponse, getServerAddr, handle, isThrottled, outputNotify, readRequest, recycle, service, setHttpTunnel, setObject, setThrottled, statsRequestEnd, statsRequestStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AJP13Connection

public AJP13Connection(AJP13Listener listener,
                       java.io.InputStream in,
                       java.io.OutputStream out,
                       java.net.Socket socket,
                       int bufferSize)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getRemoteInetAddress

public java.net.InetAddress getRemoteInetAddress()
Get the Remote address.

Overrides:
getRemoteInetAddress in class HttpConnection
Returns:
the remote address

destroy

public void destroy()
Description copied from class: HttpConnection
Destroy the connection. called by handle when handleNext returns false.

Overrides:
destroy in class HttpConnection

getRemoteAddr

public java.lang.String getRemoteAddr()
Get the Remote address.

Overrides:
getRemoteAddr in class HttpConnection
Returns:
the remote host name

getRemoteHost

public java.lang.String getRemoteHost()
Get the Remote address.

Overrides:
getRemoteHost in class HttpConnection
Returns:
the remote host name

getServerName

public java.lang.String getServerName()
Get the listeners HttpServer . Conveniance method equivalent to getListener().getHost().

Overrides:
getServerName in class HttpConnection
Returns:
HttpServer.

getServerPort

public int getServerPort()
Get the listeners Port . Conveniance method equivalent to getListener().getPort().

Overrides:
getServerPort in class HttpConnection
Returns:
HttpServer.

getDefaultScheme

public java.lang.String getDefaultScheme()
Get the listeners Default scheme. Conveniance method equivalent to getListener().getDefaultProtocol().

Overrides:
getDefaultScheme in class HttpConnection
Returns:
HttpServer.

isSSL

public boolean isSSL()

handleNext

public boolean handleNext()
Description copied from class: HttpConnection
Handle next request off the connection. The service(request,response) method is called by handle to service each request received on the connection. If the thread is a PoolThread, the thread is set as inactive when waiting for a request.

If a HttpTunnel has been set on this connection, it's handle method is called and when that completes, false is return from this method.

The Connection is set as a ThreadLocal of the calling thread and is available via the getHttpConnection() method.

Overrides:
handleNext in class HttpConnection
Returns:
true if the connection is still open and may provide more requests.

firstWrite

protected void firstWrite()
                   throws java.io.IOException
Description copied from class: HttpConnection
Setup the reponse output stream. Use the current state of the request and response, to set tranfer parameters such as chunking and content length.

Overrides:
firstWrite in class HttpConnection
Throws:
java.io.IOException

commit

protected void commit()
               throws java.io.IOException
Overrides:
commit in class HttpConnection
Throws:
java.io.IOException

setupOutputStream

protected void setupOutputStream()
                          throws java.io.IOException
Throws:
java.io.IOException


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