java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.filterchain.TransportFilter
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
SSLBaseFilter.SSLTransportFilterWrapper
Transport
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.- Author:
- Alexey Stashok
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterChainEventstatic FilterChainEventcreateFlushEvent(CompletionHandler completionHandler) protected FiltergetTransportFilter0(Transport transport) Get defaultTransportspecific transport filter.Delegates accept operation toTransport's specific transport filter.Delegates close operation toTransport's specific transport filter.Delegates connect operation toTransport's specific transport filter.handleEvent(FilterChainContext ctx, FilterChainEvent event) Delegates event operation toTransport's specific transport filter.Delegates reading operation toTransport's specific transport filter.Delegates writing operation toTransport's specific transport filter.Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, onAdded, onFilterChainChanged, onRemoved, toString
-
Constructor Details
-
TransportFilter
public TransportFilter()Create TransportFilter.
-
-
Method Details
-
createFlushEvent
-
createFlushEvent
-
handleAccept
Delegates accept operation toTransport's specific transport filter.- Specified by:
handleAcceptin interfaceFilter- Overrides:
handleAcceptin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleConnect
Delegates connect operation toTransport's specific transport filter.- Specified by:
handleConnectin interfaceFilter- Overrides:
handleConnectin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleRead
Delegates reading operation toTransport's specific transport filter.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleWrite
Delegates writing operation toTransport's specific transport filter.- Specified by:
handleWritein interfaceFilter- Overrides:
handleWritein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleEvent
Delegates event operation toTransport's specific transport filter.- Specified by:
handleEventin interfaceFilter- Overrides:
handleEventin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleClose
Delegates close operation toTransport's specific transport filter.- Specified by:
handleClosein interfaceFilter- Overrides:
handleClosein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
getTransportFilter0
Get defaultTransportspecific transport filter.
-