public class TransportFilter extends BaseFilter
Filter implementation, which should work with any Transport. This Filter tries to
delegate I/O event processing to the Transport's specific transport Filter. If Transport
doesn't have own implementation - uses common I/O event processing logic.
TransportFilter could be set to work in 2 modes: stream or message. In
stream mode, TransportFilter produces/consumes the socket channel directly.
In message mode, TransportFilter represents Connection data as Buffer, using
FilterChainContext.getMessage()}, FilterChainContext.setMessage(Object).
For specific Transport, one mode could be more preferable than another. For example TCPNIOTransport
works just in stream mode. UDPNIOTransport prefers message mode, but could also
work in stream mode.| Modifier and Type | Class and Description |
|---|---|
static class |
TransportFilter.FlushEvent |
| Constructor and Description |
|---|
TransportFilter()
Create TransportFilter.
|
| Modifier and Type | Method and Description |
|---|---|
static FilterChainEvent |
createFlushEvent() |
static FilterChainEvent |
createFlushEvent(CompletionHandler completionHandler) |
protected Filter |
getTransportFilter0(Transport transport)
Get default
Transport specific transport filter. |
NextAction |
handleAccept(FilterChainContext ctx)
Delegates accept operation to
Transport's specific transport filter. |
NextAction |
handleClose(FilterChainContext ctx)
Delegates close operation to
Transport's specific transport filter. |
NextAction |
handleConnect(FilterChainContext ctx)
Delegates connect operation to
Transport's specific transport filter. |
NextAction |
handleEvent(FilterChainContext ctx,
FilterChainEvent event)
Delegates event operation to
Transport's specific transport filter. |
NextAction |
handleRead(FilterChainContext ctx)
Delegates reading operation to
Transport's specific transport filter. |
NextAction |
handleWrite(FilterChainContext ctx)
Delegates writing operation to
Transport's specific transport filter. |
createContext, exceptionOccurred, onAdded, onFilterChainChanged, onRemoved, toStringpublic static FilterChainEvent createFlushEvent()
public static FilterChainEvent createFlushEvent(CompletionHandler completionHandler)
public NextAction handleAccept(FilterChainContext ctx) throws IOException
Transport's specific transport filter.handleAccept in interface FilterhandleAccept in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionpublic NextAction handleConnect(FilterChainContext ctx) throws IOException
Transport's specific transport filter.handleConnect in interface FilterhandleConnect in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionpublic NextAction handleRead(FilterChainContext ctx) throws IOException
Transport's specific transport filter.handleRead in interface FilterhandleRead in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionpublic NextAction handleWrite(FilterChainContext ctx) throws IOException
Transport's specific transport filter.handleWrite in interface FilterhandleWrite in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionpublic NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException
Transport's specific transport filter.handleEvent in interface FilterhandleEvent in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionpublic NextAction handleClose(FilterChainContext ctx) throws IOException
Transport's specific transport filter.handleClose in interface FilterhandleClose in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it should continue the executionIOExceptionCopyright © 2017–2020 Oracle Corporation. All rights reserved.