Java Doc for RequestHandler.java in  » Sevlet-Container » tomcat-connectors » org » apache » ajp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » tomcat connectors » org.apache.ajp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.ajp.AjpHandler
      org.apache.ajp.RequestHandler

RequestHandler
public class RequestHandler extends AjpHandler (Code)
Handle messages related with basic request information. This object can handle the following incoming messages: - "FORWARD_REQUEST" input message ( sent when a request is passed from the web server ) - "PING REQUEST" input message (sent by the web server to determine if tomcat is not frozen, a PONG REPLY will be sent back) - "RECEIVE_BODY_CHUNK" input ( sent by container to pass more body, in response to GET_BODY_CHUNK ) It can handle the following outgoing messages: - SEND_HEADERS. Pass the status code and headers. - SEND_BODY_CHUNK. Send a chunk of body - GET_BODY_CHUNK. Request a chunk of body data - END_RESPONSE. Notify the end of a request processing.
author:
   Henri Gomez [hgomez@apache.org]
author:
   Dan Milstein [danmil@shore.net]
author:
   Keith Wannamaker [Keith@Wannamaker.org]
author:
   Costin Manolache


Field Summary
final public static  byteJK_AJP13_CPING_REQUEST
    
final public static  byteJK_AJP13_CPONG_REPLY
    
final public static  byteJK_AJP13_END_RESPONSE
    
final public static  byteJK_AJP13_FORWARD_REQUEST
    
final public static  byteJK_AJP13_GET_BODY_CHUNK
    
final public static  byteJK_AJP13_PING_REQUEST
    
final public static  byteJK_AJP13_SEND_BODY_CHUNK
    
final public static  byteJK_AJP13_SEND_HEADERS
    
final public static  byteJK_AJP13_SHUTDOWN
    
final public static  byteSC_A_ARE_DONE
    
final public static  byteSC_A_AUTH_TYPE
    
final public static  byteSC_A_CONTEXT
    
final public static  byteSC_A_JVM_ROUTE
    
final public static  byteSC_A_QUERY_STRING
    
final public static  byteSC_A_REMOTE_USER
    
final public static  byteSC_A_REQ_ATTRIBUTE
    
final public static  byteSC_A_SECRET
    
final public static  byteSC_A_SERVLET_PATH
    
final public static  byteSC_A_SSL_CERT
    
final public static  byteSC_A_SSL_CIPHER
    
final public static  byteSC_A_SSL_KEY_SIZE
    
final public static  byteSC_A_SSL_SESSION
    
final public static  byteSC_A_STORED_METHOD
    
final public static  intSC_M_JK_STORED
    
final public static  intSC_REQ_ACCEPT
    
final public static  intSC_REQ_ACCEPT_CHARSET
    
final public static  intSC_REQ_ACCEPT_ENCODING
    
final public static  intSC_REQ_ACCEPT_LANGUAGE
    
final public static  intSC_REQ_AUTHORIZATION
    
final public static  intSC_REQ_CONNECTION
    
final public static  intSC_REQ_CONTENT_LENGTH
    
final public static  intSC_REQ_CONTENT_TYPE
    
final public static  intSC_REQ_COOKIE
    
final public static  intSC_REQ_COOKIE2
    
final public static  intSC_REQ_HOST
    
final public static  intSC_REQ_PRAGMA
    
final public static  intSC_REQ_REFERER
    
final public static  intSC_REQ_USER_AGENT
    
final public static  intSC_RESP_CONTENT_LANGUAGE
    
final public static  intSC_RESP_CONTENT_LENGTH
    
final public static  intSC_RESP_CONTENT_TYPE
    
final public static  intSC_RESP_DATE
    
final public static  intSC_RESP_LAST_MODIFIED
    
final public static  intSC_RESP_LOCATION
    
final public static  intSC_RESP_SERVLET_ENGINE
    
final public static  intSC_RESP_SET_COOKIE
    
final public static  intSC_RESP_SET_COOKIE2
    
final public static  intSC_RESP_STATUS
    
final public static  intSC_RESP_WWW_AUTHENTICATE
    
final public static  String[]headerTransArray
    
final public static  String[]methodTransArray
    

Constructor Summary
public  RequestHandler()
    

Method Summary
public  intavailable(Ajp13 ch)
    
public  voidbeginSendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, int numHeaders)
    
protected  intdecodeRequest(Ajp13 ch, Ajp13Packet msg, BaseRequest req)
     Parse a FORWARD_REQUEST packet from the web server and store its properties in the passed-in request object.
Parameters:
  req - An empty (newly-recycled) request object.
Parameters:
  msg - Holds the packet which has just been sent by the webserver, with its read position just past the packet header (which inthis case includes the prefix code for FORWARD_REQUEST).
public  intdoRead(Ajp13 ch)
     Return the next byte of request body data (to a servlet).
public  intdoRead(Ajp13 ch, byte[] b, int off, int len)
     Store a chunk of request data into the passed-in byte buffer.
Parameters:
  b - A buffer to fill with data from the request.
Parameters:
  off - The offset in the buffer at which to start filling.
Parameters:
  len - The number of bytes to copy into the buffer.
public  voiddoWrite(Ajp13 ch, Ajp13Packet outBuf, byte b, int off, int len)
     Send a chunk of response body data to the web server and on to the browser.
public  voidendSendHeaders(Ajp13 ch, Ajp13Packet outBuf)
    
public  voidfinish(Ajp13 ch, Ajp13Packet outBuf)
     Signal the web server that the servlet has finished handling this request, and that the connection can be reused.
public  inthandleAjpMessage(int type, Ajp13 channel, Ajp13Packet ajp, BaseRequest req)
    
protected  intheaderNameToSc(String name)
     Translate an HTTP response header name to an integer code if possible.
public  voidinit(Ajp13 ajp14)
    
 voidlog(String s)
    
public  booleanrefillReadBuffer(Ajp13 ch)
     Get more request body data from the web server and store it in the internal buffer. true if there is more data, false if not.
public  intsendCPong(Ajp13 ch, Ajp13Packet outBuf)
    
public  voidsendHeader(Ajp13Packet outBuf, String name, String value)
    
public  voidsendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, MimeHeaders headers)
     Send the HTTP headers back to the web server and on to the browser.
public  voidsendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, MimeHeaders headers)
     Send the HTTP headers back to the web server and on to the browser.
public  voidsetDebug(int debug)
    
public  voidsetLogger(Logger l)
    

Field Detail
JK_AJP13_CPING_REQUEST
final public static byte JK_AJP13_CPING_REQUEST(Code)



JK_AJP13_CPONG_REPLY
final public static byte JK_AJP13_CPONG_REPLY(Code)



JK_AJP13_END_RESPONSE
final public static byte JK_AJP13_END_RESPONSE(Code)



JK_AJP13_FORWARD_REQUEST
final public static byte JK_AJP13_FORWARD_REQUEST(Code)



JK_AJP13_GET_BODY_CHUNK
final public static byte JK_AJP13_GET_BODY_CHUNK(Code)



JK_AJP13_PING_REQUEST
final public static byte JK_AJP13_PING_REQUEST(Code)



JK_AJP13_SEND_BODY_CHUNK
final public static byte JK_AJP13_SEND_BODY_CHUNK(Code)



JK_AJP13_SEND_HEADERS
final public static byte JK_AJP13_SEND_HEADERS(Code)



JK_AJP13_SHUTDOWN
final public static byte JK_AJP13_SHUTDOWN(Code)



SC_A_ARE_DONE
final public static byte SC_A_ARE_DONE(Code)



SC_A_AUTH_TYPE
final public static byte SC_A_AUTH_TYPE(Code)



SC_A_CONTEXT
final public static byte SC_A_CONTEXT(Code)



SC_A_JVM_ROUTE
final public static byte SC_A_JVM_ROUTE(Code)



SC_A_QUERY_STRING
final public static byte SC_A_QUERY_STRING(Code)



SC_A_REMOTE_USER
final public static byte SC_A_REMOTE_USER(Code)



SC_A_REQ_ATTRIBUTE
final public static byte SC_A_REQ_ATTRIBUTE(Code)



SC_A_SECRET
final public static byte SC_A_SECRET(Code)



SC_A_SERVLET_PATH
final public static byte SC_A_SERVLET_PATH(Code)



SC_A_SSL_CERT
final public static byte SC_A_SSL_CERT(Code)



SC_A_SSL_CIPHER
final public static byte SC_A_SSL_CIPHER(Code)



SC_A_SSL_KEY_SIZE
final public static byte SC_A_SSL_KEY_SIZE(Code)



SC_A_SSL_SESSION
final public static byte SC_A_SSL_SESSION(Code)



SC_A_STORED_METHOD
final public static byte SC_A_STORED_METHOD(Code)



SC_M_JK_STORED
final public static int SC_M_JK_STORED(Code)



SC_REQ_ACCEPT
final public static int SC_REQ_ACCEPT(Code)



SC_REQ_ACCEPT_CHARSET
final public static int SC_REQ_ACCEPT_CHARSET(Code)



SC_REQ_ACCEPT_ENCODING
final public static int SC_REQ_ACCEPT_ENCODING(Code)



SC_REQ_ACCEPT_LANGUAGE
final public static int SC_REQ_ACCEPT_LANGUAGE(Code)



SC_REQ_AUTHORIZATION
final public static int SC_REQ_AUTHORIZATION(Code)



SC_REQ_CONNECTION
final public static int SC_REQ_CONNECTION(Code)



SC_REQ_CONTENT_LENGTH
final public static int SC_REQ_CONTENT_LENGTH(Code)



SC_REQ_CONTENT_TYPE
final public static int SC_REQ_CONTENT_TYPE(Code)



SC_REQ_COOKIE
final public static int SC_REQ_COOKIE(Code)



SC_REQ_COOKIE2
final public static int SC_REQ_COOKIE2(Code)



SC_REQ_HOST
final public static int SC_REQ_HOST(Code)



SC_REQ_PRAGMA
final public static int SC_REQ_PRAGMA(Code)



SC_REQ_REFERER
final public static int SC_REQ_REFERER(Code)



SC_REQ_USER_AGENT
final public static int SC_REQ_USER_AGENT(Code)



SC_RESP_CONTENT_LANGUAGE
final public static int SC_RESP_CONTENT_LANGUAGE(Code)



SC_RESP_CONTENT_LENGTH
final public static int SC_RESP_CONTENT_LENGTH(Code)



SC_RESP_CONTENT_TYPE
final public static int SC_RESP_CONTENT_TYPE(Code)



SC_RESP_DATE
final public static int SC_RESP_DATE(Code)



SC_RESP_LAST_MODIFIED
final public static int SC_RESP_LAST_MODIFIED(Code)



SC_RESP_LOCATION
final public static int SC_RESP_LOCATION(Code)



SC_RESP_SERVLET_ENGINE
final public static int SC_RESP_SERVLET_ENGINE(Code)



SC_RESP_SET_COOKIE
final public static int SC_RESP_SET_COOKIE(Code)



SC_RESP_SET_COOKIE2
final public static int SC_RESP_SET_COOKIE2(Code)



SC_RESP_STATUS
final public static int SC_RESP_STATUS(Code)



SC_RESP_WWW_AUTHENTICATE
final public static int SC_RESP_WWW_AUTHENTICATE(Code)



headerTransArray
final public static String[] headerTransArray(Code)



methodTransArray
final public static String[] methodTransArray(Code)




Constructor Detail
RequestHandler
public RequestHandler()(Code)




Method Detail
available
public int available(Ajp13 ch) throws IOException(Code)



beginSendHeaders
public void beginSendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, int numHeaders) throws IOException(Code)



decodeRequest
protected int decodeRequest(Ajp13 ch, Ajp13Packet msg, BaseRequest req) throws IOException(Code)
Parse a FORWARD_REQUEST packet from the web server and store its properties in the passed-in request object.
Parameters:
  req - An empty (newly-recycled) request object.
Parameters:
  msg - Holds the packet which has just been sent by the webserver, with its read position just past the packet header (which inthis case includes the prefix code for FORWARD_REQUEST). 200 in case of a successful decoduing, 500 in case of error.



doRead
public int doRead(Ajp13 ch) throws IOException(Code)
Return the next byte of request body data (to a servlet).
See Also:   Request.doRead



doRead
public int doRead(Ajp13 ch, byte[] b, int off, int len) throws IOException(Code)
Store a chunk of request data into the passed-in byte buffer.
Parameters:
  b - A buffer to fill with data from the request.
Parameters:
  off - The offset in the buffer at which to start filling.
Parameters:
  len - The number of bytes to copy into the buffer. The number of bytes actually copied into the buffer, or -1if the end of the stream has been reached.
See Also:   Request.doRead



doWrite
public void doWrite(Ajp13 ch, Ajp13Packet outBuf, byte b, int off, int len) throws IOException(Code)
Send a chunk of response body data to the web server and on to the browser.
Parameters:
  b - A huffer of bytes to send.
Parameters:
  off - The offset into the buffer from which to start sending.
Parameters:
  len - The number of bytes to send.



endSendHeaders
public void endSendHeaders(Ajp13 ch, Ajp13Packet outBuf) throws IOException(Code)



finish
public void finish(Ajp13 ch, Ajp13Packet outBuf) throws IOException(Code)
Signal the web server that the servlet has finished handling this request, and that the connection can be reused.



handleAjpMessage
public int handleAjpMessage(int type, Ajp13 channel, Ajp13Packet ajp, BaseRequest req) throws IOException(Code)



headerNameToSc
protected int headerNameToSc(String name)(Code)
Translate an HTTP response header name to an integer code if possible. Case is ignored.
Parameters:
  name - The name of the response header to translate. The code for that header name, or -1 if no code exists.



init
public void init(Ajp13 ajp14)(Code)



log
void log(String s)(Code)



refillReadBuffer
public boolean refillReadBuffer(Ajp13 ch) throws IOException(Code)
Get more request body data from the web server and store it in the internal buffer. true if there is more data, false if not.



sendCPong
public int sendCPong(Ajp13 ch, Ajp13Packet outBuf)(Code)
Send a CPONG REPLY to web server to its CPING request
Parameters:
  ch - the Ajp13 channel
Parameters:
  outBuf - the Ajp13Packet output packet to use



sendHeader
public void sendHeader(Ajp13Packet outBuf, String name, String value) throws IOException(Code)



sendHeaders
public void sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, MimeHeaders headers) throws IOException(Code)
Send the HTTP headers back to the web server and on to the browser.
Parameters:
  status - The HTTP status code to send.
Parameters:
  statusMessage - the HTTP status message to send.
Parameters:
  headers - The set of all headers.



sendHeaders
public void sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, MimeHeaders headers) throws IOException(Code)
Send the HTTP headers back to the web server and on to the browser.
Parameters:
  status - The HTTP status code to send.
Parameters:
  headers - The set of all headers.



setDebug
public void setDebug(int debug)(Code)



setLogger
public void setLogger(Logger l)(Code)



Fields inherited from org.apache.ajp.AjpHandler
final public static int UNKNOWN(Code)(Java Doc)
Ajp13 channel(Code)(Java Doc)

Methods inherited from org.apache.ajp.AjpHandler
public int handleAjpMessage(int type, Ajp13 channel, Ajp13Packet ajp, BaseRequest req) throws IOException(Code)(Java Doc)
public void init(Ajp13 channel)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.