public class MultiLineFilter extends BaseFilter
Filter is responsible for a
String <-> MultiLinePacket transformations.
When reading - filter is gathering single String lines into a MultiLinePacket,
when writing - filter breaks MultiLinePacket into a single Strings.| Constructor and Description |
|---|
MultiLineFilter(String terminatingLine) |
| Modifier and Type | Method and Description |
|---|---|
NextAction |
handleRead(FilterChainContext ctx)
The method is called once we have received a single
String line. |
NextAction |
handleWrite(FilterChainContext ctx)
The method is called whem we send MultiLinePacket.
|
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemovedpublic MultiLineFilter(String terminatingLine)
public NextAction handleRead(FilterChainContext ctx) throws IOException
String line.
Filter check if it's MultiLinePacket terminating line, if yes -
we assume MultiLinePacket completed and pass control to a next
Filter in a chain. If it's not a
terminating line - we add another string line to a MultiLinePacket
and stop the request processing until more strings will get available.handleRead in interface FilterhandleRead in class BaseFilterctx - Request processing contextNextActionIOExceptionpublic NextAction handleWrite(FilterChainContext ctx) throws IOException
handleWrite in interface FilterhandleWrite in class BaseFilterctx - Request processing contextNextActionIOExceptionCopyright © 2015 Oracle Corporation. All rights reserved.