public class MultiLineFilter extends BaseFilter
Filter is responsible for a
List<String> <-> MultiLinePacket transformations.
When reading - filter is gathering String lines into a MultiLinePacket,
when writing - filter breaks MultiLinePacket into String list.| 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 when we send MultiLinePacket.
|
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved, toStringpublic 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 © 2016 Oracle Corporation. All rights reserved.