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)
Execute a unit of processing work to be performed, when connection
has been closed.
|
NextAction |
handleEvent(FilterChainContext ctx,
FilterChainEvent event)
Handle custom event associated with the
Connection. |
NextAction |
handleRead(FilterChainContext ctx)
Execute a unit of processing work to be performed, when channel will
become available for reading.
|
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
BaseFilterFilter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.handleRead in interface FilterhandleRead in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionpublic NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException
BaseFilterConnection.
This Filter may either complete the required processing and
return StopAction, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning InvokeAction.handleEvent in interface FilterhandleEvent in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionpublic NextAction handleClose(FilterChainContext ctx) throws IOException
BaseFilterFilter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.handleClose in interface FilterhandleClose in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionprotected void findProtocol(PUContext puContext, FilterChainContext ctx)
Copyright © 2017 Oracle Corporation. All Rights Reserved.