ii
Preface ................................................................................................................................... iv
1. HttpCore Scope ........................................................................................................... iv
2. HttpCore Goals ........................................................................................................... iv
3. What HttpCore is NOT ............................................................................................... iv
1. Fundamentals ....................................................................................................................... 1
1.1. HTTP messages ........................................................................................................ 1
1.1.1. Structure ........................................................................................................ 1
1.1.2. Basic operations ............................................................................................. 1
1.1.3. HTTP entity ................................................................................................... 3
1.1.4. Creating entities .............................................................................................. 5
1.2. Blocking HTTP connections ...................................................................................... 7
1.2.1. Working with blocking HTTP connections ....................................................... 8
1.2.2. Content transfer with blocking I/O ................................................................... 9
1.2.3. Supported content transfer mechanisms ............................................................ 9
1.2.4. Terminating HTTP connections ....................................................................... 9
1.3. HTTP exception handling ........................................................................................ 10
1.3.1. Protocol exception ........................................................................................ 10
1.4. HTTP protocol processors ........................................................................................ 10
1.4.1. Standard protocol interceptors ........................................................................ 10
1.4.2. Working with protocol processors .................................................................. 11
1.4.3. HTTP context ............................................................................................... 12
1.5. HTTP parameters .................................................................................................... 13
1.5.1. HTTP parameter beans .................................................................................. 14
1.6. Blocking HTTP protocol handlers ............................................................................ 14
1.6.1. HTTP service ............................................................................................... 14
1.6.2. HTTP request executor .................................................................................. 16
1.6.3. Connection persistence / re-use ...................................................................... 16
2. NIO extensions .................................................................................................................. 18
2.1. Benefits and shortcomings of the non-blocking I/O model .......................................... 18
2.2. Differences from other NIO frameworks ................................................................... 18
2.3. I/O reactor .............................................................................................................. 18
2.3.1. I/O dispatchers .............................................................................................. 18
2.3.2. I/O reactor shutdown ..................................................................................... 19
2.3.3. I/O sessions .................................................................................................. 19
2.3.4. I/O session state management ........................................................................ 19
2.3.5. I/O session event mask .................................................................................. 20
2.3.6. I/O session buffers ........................................................................................ 20
2.3.7. I/O session shutdown .................................................................................... 20
2.3.8. Listening I/O reactors .................................................................................... 20
2.3.9. Connecting I/O reactors ................................................................................. 21
2.3.10. Queuing of I/O interest set operations .......................................................... 22
2.4. I/O reactor exception handling ................................................................................. 23
2.4.1. I/O reactor audit log ...................................................................................... 23
2.5. Non-blocking HTTP connections .............................................................................. 24
2.5.1. Execution context of non-blocking HTTP connections ..................................... 24
2.5.2. Working with non-blocking HTTP connections ............................................... 24
2.5.3. HTTP I/O control ......................................................................................... 25
2.5.4. Non-blocking content transfer ........................................................................ 26
2.5.5. Supported non-blocking content transfer mechanisms ...................................... 27