com.sun.grizzly.standalone
Class StaticStreamAlgorithm

java.lang.Object
  extended by com.sun.grizzly.http.algorithms.StreamAlgorithmBase
      extended by com.sun.grizzly.standalone.StaticStreamAlgorithm
All Implemented Interfaces:
StreamAlgorithm<SocketChannel>
Direct Known Subclasses:
ContainerStaticStreamAlgorithm

public class StaticStreamAlgorithm
extends StreamAlgorithmBase

This algorithm doesn't parse the bytes, delegating the work to the InternalInputBuffer.

Author:
Jeanfrancois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase
StreamAlgorithmBase.DummyHandler
 
Field Summary
 
Fields inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase
contentLength, curLimit, curPosition, handler, headerLength, lastStatePosition, primaryByteBuffer, socketChannel, state, useByteBufferView, useDirectByteBuffer
 
Constructor Summary
StaticStreamAlgorithm()
           
 
Method Summary
 Interceptor getHandler()
          Return the Interceptor used by this algorithm.
 boolean parse(ByteBuffer byteBuffer)
          Do not parse the bytes and automatically flip the ByteBuffer
 ByteBuffer preParse(ByteBuffer byteBuffer)
          Do nothing, as the ByteBufferInputStream will take care of reading the missing bytes.
 void recycle()
          Recycle this object.
 
Methods inherited from class com.sun.grizzly.http.algorithms.StreamAlgorithmBase
allocate, contentLength, dump, getPort, headerLength, postParse, rollbackParseState, setChannel, setPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticStreamAlgorithm

public StaticStreamAlgorithm()
Method Detail

preParse

public ByteBuffer preParse(ByteBuffer byteBuffer)
Do nothing, as the ByteBufferInputStream will take care of reading the missing bytes.

Specified by:
preParse in interface StreamAlgorithm<SocketChannel>
Overrides:
preParse in class StreamAlgorithmBase
Parameters:
byteBuffer - the ByteBuffer used by this algorithm
Returns:
ByteBuffer used by this algorithm

parse

public boolean parse(ByteBuffer byteBuffer)
Do not parse the bytes and automatically flip the ByteBuffer

Specified by:
parse in interface StreamAlgorithm<SocketChannel>
Specified by:
parse in class StreamAlgorithmBase
Parameters:
byteBuffer - the bytes read.
Returns:
true if the algorithm determines the process can continue.

getHandler

public Interceptor getHandler()
Return the Interceptor used by this algorithm.

Returns:
Interceptor

recycle

public void recycle()
Recycle this object.

Specified by:
recycle in interface StreamAlgorithm<SocketChannel>
Overrides:
recycle in class StreamAlgorithmBase


Copyright © 2013 Oracle Corporation. All Rights Reserved.