public class PUFilter extends BaseFilter
| Constructor and Description |
|---|
PUFilter() |
PUFilter(boolean isCloseUnrecognizedConnection)
Constructs PUFilter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deregister(PUProtocol puProtocol)
Deregisters the
PUProtocol. |
protected void |
findProtocol(PUContext puContext,
FilterChainContext ctx) |
Filter |
getBackChannelFilter()
Get the back channel
Filter implementation, which should connect the
custom protocol FilterChain with the main FilterChain. |
Set<PUProtocol> |
getProtocols()
Get registered port unification protocols -
PUProtocols. |
FilterChainBuilder |
getPUFilterChainBuilder()
Returns the
FilterChainBuilder, developers may use to build there
custom protocol filter chain. |
NextAction |
handleClose(FilterChainContext ctx) |
NextAction |
handleEvent(FilterChainContext ctx,
FilterChainEvent event) |
NextAction |
handleRead(FilterChainContext ctx) |
boolean |
isCloseUnrecognizedConnection()
Returns true if a
Connection whose protocol is not recognized
will be automatically closed, or false if normal
FilterChain processing will be continued for such Connection,
so a Filter next to PUFilter may implement custom logic
to process unrecognized connection. |
PUProtocol |
register(ProtocolFinder protocolFinder,
FilterChain filterChain)
Registers new
ProtocolFinder - FilterChain pair, which
defines the protocol. |
void |
register(PUProtocol puProtocol)
Registers new
PUProtocol. |
createContext, exceptionOccurred, handleAccept, handleConnect, handleWrite, onAdded, onFilterChainChanged, onRemoved, toStringpublic PUFilter()
public PUFilter(boolean isCloseUnrecognizedConnection)
isCloseUnrecognizedConnection - true if a Connection
whose protocol is not recognized will be automatically closed,
or false if normal FilterChain processing will be
continued for such Connection, so a Filter next to
PUFilter may implement custom logic to process unrecognized connection.public PUProtocol register(ProtocolFinder protocolFinder, FilterChain filterChain)
ProtocolFinder - FilterChain pair, which
defines the protocol.protocolFinder - ProtocolFinderfilterChain - FilterChainPUProtocol, which wraps passed ProtocolFinder and FilterChain.public void register(PUProtocol puProtocol)
PUProtocol.puProtocol - PUProtocolpublic void deregister(PUProtocol puProtocol)
PUProtocol.puProtocol - PUProtocolpublic Set<PUProtocol> getProtocols()
PUProtocols.PUProtocol Set.public Filter getBackChannelFilter()
Filter implementation, which should connect the
custom protocol FilterChain with the main FilterChain.
Usually developers shouldn't use this method, if they build custom protocol
chains using getPUFilterChainBuilder(), otherwise they have to
make sure there custom protocol FilterChain contains back channel
Filter (usually first Filter in the custom protocol filter chain).Filter.public FilterChainBuilder getPUFilterChainBuilder()
FilterChainBuilder, developers may use to build there
custom protocol filter chain.
The returned FilterChainBuilder may have some Filters pre-added.FilterChainBuilder.public boolean isCloseUnrecognizedConnection()
Connection whose protocol is not recognized
will be automatically closed, or false if normal
FilterChain processing will be continued for such Connection,
so a Filter next to PUFilter may implement custom logic
to process unrecognized connection.public NextAction handleRead(FilterChainContext ctx) throws IOException
handleRead in interface FilterhandleRead in class BaseFilterIOExceptionpublic NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException
handleEvent in interface FilterhandleEvent in class BaseFilterIOExceptionpublic NextAction handleClose(FilterChainContext ctx) throws IOException
handleClose in interface FilterhandleClose in class BaseFilterIOExceptionprotected void findProtocol(PUContext puContext, FilterChainContext ctx)
Copyright © 2016 Oracle Corporation. All Rights Reserved.