|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.ara.algorithms.ContextRootAlgorithm
public class ContextRootAlgorithm
Parse the request bytes and seek for the context-root value of the HTTP method.
| Constructor Summary | |
|---|---|
ContextRootAlgorithm()
|
|
| Method Summary | |
|---|---|
ByteBuffer |
allocate(boolean useDirect,
boolean useView,
int size)
Allocate a ByteBuffer |
int |
contentLength()
Return the stream content-length. |
Handler |
getHandler()
Return null as handler aren't required. |
int |
getPort()
Return the port |
Class |
getReadTask(SelectorThread selectorThread)
Return the class responsible for handling OP_READ. |
int |
headerLength()
Return the stream header length. |
boolean |
parse(ByteBuffer byteBuffer)
Parse the request line in search of the context-root bytes of the HTTP Method. |
ByteBuffer |
postParse(ByteBuffer byteBuffer)
After parsing the bytes, post process the ByteBuffer |
ByteBuffer |
preParse(ByteBuffer byteBuffer)
Before parsing the bytes, initialize and prepare the algorithm. |
void |
recycle()
Recycle the algorithm. |
ByteBuffer |
rollbackParseState(ByteBuffer byteBuffer)
Rollback the ByteBuffer to its previous state in case
an error as occured. |
void |
setPort(int port)
Set the port |
void |
setSocketChannel(SocketChannel socketChannel)
Set the SocketChannel used by this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContextRootAlgorithm()
| Method Detail |
|---|
public ByteBuffer allocate(boolean useDirect,
boolean useView,
int size)
ByteBuffer
allocate in interface StreamAlgorithmuseDirect - allocate a direct ByteBuffer.useView - allocate a view ByteBuffer.size - the size of the newly created ByteBuffer.
ByteBufferpublic int contentLength()
contentLength in interface StreamAlgorithmpublic int headerLength()
headerLength in interface StreamAlgorithmpublic boolean parse(ByteBuffer byteBuffer)
ByteBuffer position and limit refer
respectively to the start and the end of the context root.
parse in interface StreamAlgorithmbyteBuffer - The byteBuffer containing the requests bytes
public ByteBuffer postParse(ByteBuffer byteBuffer)
ByteBuffer
postParse in interface StreamAlgorithmbyteBuffer - the ByteBuffer used by this algorithm
ByteBuffer used by this algorithmpublic ByteBuffer preParse(ByteBuffer byteBuffer)
preParse in interface StreamAlgorithmbyteBuffer - the ByteBuffer used by this algorithm
ByteBuffer used by this algorithmpublic void recycle()
recycle in interface StreamAlgorithmpublic ByteBuffer rollbackParseState(ByteBuffer byteBuffer)
ByteBuffer to its previous state in case
an error as occured.
rollbackParseState in interface StreamAlgorithmpublic Class getReadTask(SelectorThread selectorThread)
getReadTask in interface StreamAlgorithmpublic void setSocketChannel(SocketChannel socketChannel)
SocketChannel used by this class.
setSocketChannel in interface StreamAlgorithmpublic Handler getHandler()
getHandler in interface StreamAlgorithmpublic void setPort(int port)
setPort in interface StreamAlgorithmpublic int getPort()
getPort in interface StreamAlgorithm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||