Java Doc for InternalNioInputBuffer.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » coyote » http11 » 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 » apache tomcat 6.0.14 » org.apache.coyote.http11 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.coyote.http11.InternalNioInputBuffer

InternalNioInputBuffer
public class InternalNioInputBuffer implements InputBuffer(Code)
Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.
author:
   Remy Maucherat
author:
   Filip Hanik

Inner Class : enum HeaderParseStatus
Inner Class : enum HeaderParsePosition
Inner Class :public static class HeaderParseData
Inner Class :protected class SocketInputBuffer implements InputBuffer

Field Summary
protected  InputFilter[]activeFilters
     Active filters (in order).
protected  byte[]buf
     Pointer to the current read buffer.
protected  intend
     Pos of the end of the header in the buffer, which is also the start of the body.
protected  InputFilter[]filterLibrary
     Filter library.
protected  HeaderParseDataheaderData
    
protected  HeaderParsePositionheaderParsePos
    
protected  MimeHeadersheaders
     Headers of the associated request.
protected  InputBufferinputStreamInputBuffer
     Underlying input buffer.
protected  intlastActiveFilter
     Index of the last active filter.
protected  intlastValid
     Last valid byte.
protected  booleanparsingHeader
     State.
protected  booleanparsingRequestLine
    
protected  NioSelectorPoolpool
    
protected  intpos
     Position in the buffer.
protected  longreadTimeout
     The socket timeout used when reading the first block of the request header.
protected  Requestrequest
     Associated Coyote request.
protected static  StringManagersm
     The string manager for this package.
protected  NioChannelsocket
     Underlying socket.
protected  booleanswallowInput
    

Constructor Summary
public  InternalNioInputBuffer(Request request, int headerBufferSize, long readTimeout)
     Alternate constructor.

Method Summary
public  voidaddActiveFilter(InputFilter filter)
     Add an input filter to the filter library.
public  voidaddFilter(InputFilter filter)
     Add an input filter to the filter library.
public  intavailable()
    
public  voidclearFilters()
     Clear filters.
public  intdoRead(ByteChunk chunk, Request req)
     Read some bytes.
public  voidendRequest()
     End request (consumes leftover bytes).
protected  booleanfill(boolean timeout, boolean block)
     Fill the internal buffer using data from the undelying input stream.
public  InputFilter[]getFilters()
     Get filters.
public  NioSelectorPoolgetSelectorPool()
    
public  NioChannelgetSocket()
     Get the underlying socket input stream.
public  voidnextRequest()
     End processing of current HTTP request. Note: All bytes of the current request should have been already consumed.
public  HeaderParseStatusparseHeader()
     Parse an HTTP header.
public  booleanparseHeaders()
     Parse the HTTP headers.
public  booleanparseRequestLine(boolean useAvailableData)
     Read the request line.
public  voidrecycle()
     Recycle the input buffer.
public  voidsetSelectorPool(NioSelectorPool pool)
    
public  voidsetSocket(NioChannel socket)
     Set the underlying socket.
public  voidsetSwallowInput(boolean swallowInput)
     Set the swallow input flag.

Field Detail
activeFilters
protected InputFilter[] activeFilters(Code)
Active filters (in order).



buf
protected byte[] buf(Code)
Pointer to the current read buffer.



end
protected int end(Code)
Pos of the end of the header in the buffer, which is also the start of the body.



filterLibrary
protected InputFilter[] filterLibrary(Code)
Filter library. Note: Filter[0] is always the "chunked" filter.



headerData
protected HeaderParseData headerData(Code)



headerParsePos
protected HeaderParsePosition headerParsePos(Code)



headers
protected MimeHeaders headers(Code)
Headers of the associated request.



inputStreamInputBuffer
protected InputBuffer inputStreamInputBuffer(Code)
Underlying input buffer.



lastActiveFilter
protected int lastActiveFilter(Code)
Index of the last active filter.



lastValid
protected int lastValid(Code)
Last valid byte.



parsingHeader
protected boolean parsingHeader(Code)
State.



parsingRequestLine
protected boolean parsingRequestLine(Code)



pool
protected NioSelectorPool pool(Code)
Selector pool, for blocking reads and blocking writes



pos
protected int pos(Code)
Position in the buffer.



readTimeout
protected long readTimeout(Code)
The socket timeout used when reading the first block of the request header.



request
protected Request request(Code)
Associated Coyote request.



sm
protected static StringManager sm(Code)
The string manager for this package.



socket
protected NioChannel socket(Code)
Underlying socket.



swallowInput
protected boolean swallowInput(Code)
Swallow input ? (in the case of an expectation)




Constructor Detail
InternalNioInputBuffer
public InternalNioInputBuffer(Request request, int headerBufferSize, long readTimeout)(Code)
Alternate constructor.




Method Detail
addActiveFilter
public void addActiveFilter(InputFilter filter)(Code)
Add an input filter to the filter library.



addFilter
public void addFilter(InputFilter filter)(Code)
Add an input filter to the filter library.



available
public int available()(Code)
Available bytes (note that due to encoding, this may not correspond )



clearFilters
public void clearFilters()(Code)
Clear filters.



doRead
public int doRead(ByteChunk chunk, Request req) throws IOException(Code)
Read some bytes.



endRequest
public void endRequest() throws IOException(Code)
End request (consumes leftover bytes).
throws:
  IOException - an undelying I/O error occured



fill
protected boolean fill(boolean timeout, boolean block) throws IOException, EOFException(Code)
Fill the internal buffer using data from the undelying input stream. false if at end of stream



getFilters
public InputFilter[] getFilters()(Code)
Get filters.



getSelectorPool
public NioSelectorPool getSelectorPool()(Code)



getSocket
public NioChannel getSocket()(Code)
Get the underlying socket input stream.



nextRequest
public void nextRequest()(Code)
End processing of current HTTP request. Note: All bytes of the current request should have been already consumed. This method only resets all the pointers so that we are ready to parse the next HTTP request.



parseHeader
public HeaderParseStatus parseHeader() throws IOException(Code)
Parse an HTTP header. false after reading a blank line (which indicates that theHTTP header parsing is done



parseHeaders
public boolean parseHeaders() throws IOException(Code)
Parse the HTTP headers.



parseRequestLine
public boolean parseRequestLine(boolean useAvailableData) throws IOException(Code)
Read the request line. This function is meant to be used during the HTTP request header parsing. Do NOT attempt to read the request body using it.
throws:
  IOException - If an exception occurs during the underlying socketread operations, or if the given buffer is not big enough to accomodatethe whole line. true if data is properly fed; false if no data is available immediately and thread should be freed



recycle
public void recycle()(Code)
Recycle the input buffer. This should be called when closing the connection.



setSelectorPool
public void setSelectorPool(NioSelectorPool pool)(Code)



setSocket
public void setSocket(NioChannel socket)(Code)
Set the underlying socket.



setSwallowInput
public void setSwallowInput(boolean swallowInput)(Code)
Set the swallow input flag.



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.