Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.http.ajp
Class AJP13Connection  view AJP13Connection download AJP13Connection.java

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

public class AJP13Connection
extends org.mortbay.http.HttpConnection

Version:
$Id: AJP13Connection.java,v 1.27 2003/10/05 23:46:23 gregwilkins Exp $

Field Summary
private  AJP13InputStream _ajpIn
           
private  AJP13OutputStream _ajpOut
           
private  boolean _isSSL
           
private  AJP13Listener _listener
           
private  java.lang.String _remoteAddr
           
private  java.lang.String _remoteHost
           
private  java.lang.String _serverName
           
private  int _serverPort
           
private static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.mortbay.http.HttpConnection
_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
 

Field Detail

log

private static org.apache.commons.logging.Log log

_listener

private AJP13Listener _listener

_ajpIn

private AJP13InputStream _ajpIn

_ajpOut

private AJP13OutputStream _ajpOut

_remoteHost

private java.lang.String _remoteHost

_remoteAddr

private java.lang.String _remoteAddr

_serverName

private java.lang.String _serverName

_serverPort

private int _serverPort

_isSSL

private boolean _isSSL
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
Method Detail

getRemoteInetAddress

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


destroy

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


getRemoteAddr

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


getRemoteHost

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


getServerName

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


getServerPort

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


getDefaultScheme

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


isSSL

public boolean isSSL()

handleNext

public boolean handleNext()
Description copied from class: org.mortbay.http.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.


firstWrite

protected void firstWrite()
                   throws java.io.IOException
Description copied from class: org.mortbay.http.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.


commit

protected void commit()
               throws java.io.IOException

setupOutputStream

protected void setupOutputStream()
                          throws java.io.IOException