|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.filterchain.FilterAdapter
com.sun.grizzly.filterchain.TransportFilter
public class TransportFilter
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: TransportFilter.Mode.Stream
or TransportFilter.Mode.Message. In the TransportFilter.Mode.Stream mode,
TransportFilter produces/consumes Connection data using
FilterChainContext.getStreamReader(), FilterChainContext.getStreamWriter().
In the TransportFilter.Mode.Message mode, TransportFilter represents Connection
data as Buffer, using FilterChainContext#getMessage(},
FilterChainContext#setMessage().
For specific Transport, one mode could be more preferable than another.
For example TCPNIOTransport works just in TransportFilter.Mode.Stream mode,
UDPNIOTransport prefers TransportFilter.Mode.Message mode, but could also work
in TransportFilter.Mode.Stream mode.
| Nested Class Summary | |
|---|---|
static class |
TransportFilter.Mode
|
| Field Summary | |
|---|---|
static String |
WORKER_THREAD_BUFFER_NAME
|
| Constructor Summary | |
|---|---|
TransportFilter()
Create TransportFilter, which will operate in TransportFilter.Mode.Stream mode. |
|
TransportFilter(TransportFilter.Mode mode)
Create TransportFilter, which will operate in defined mode. |
|
| Method Summary | |
|---|---|
TransportFilter.Mode |
getMode()
Get the TransportFilter mode. |
protected Filter |
getTransportFilter0(Transport transport)
Get default Transport specific transport filter. |
NextAction |
handleAccept(FilterChainContext ctx,
NextAction nextAction)
Delegates accept operation to Transport's specific transport
filter. |
NextAction |
handleClose(FilterChainContext ctx,
NextAction nextAction)
Delegates close operation to Transport's specific transport
filter. |
NextAction |
handleConnect(FilterChainContext ctx,
NextAction nextAction)
Delegates connect operation to Transport's specific transport
filter. |
NextAction |
handleRead(FilterChainContext ctx,
NextAction nextAction)
Delegates reading operation to Transport's specific transport
filter. |
NextAction |
handleWrite(FilterChainContext ctx,
NextAction nextAction)
Delegates writing operation to Transport's specific transport
filter. |
NextAction |
postAccept(FilterChainContext ctx,
NextAction nextAction)
Delegates post accepting processing to Transport's specific
transport filter. |
NextAction |
postClose(FilterChainContext ctx,
NextAction nextAction)
Delegates post closing processing to Transport's specific
transport filter. |
NextAction |
postConnect(FilterChainContext ctx,
NextAction nextAction)
Delegates post connecting processing to Transport's specific
transport filter. |
NextAction |
postRead(FilterChainContext ctx,
NextAction nextAction)
Delegates post reading processing to Transport's specific
transport filter. |
NextAction |
postWrite(FilterChainContext ctx,
NextAction nextAction)
Delegates post writing processing to Transport's specific
transport filter. |
| Methods inherited from class com.sun.grizzly.filterchain.FilterAdapter |
|---|
exceptionOccurred, getFilterChain, getIndex, isIndexable, setIndex |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String WORKER_THREAD_BUFFER_NAME
| Constructor Detail |
|---|
public TransportFilter()
TransportFilter.Mode.Stream mode.
public TransportFilter(TransportFilter.Mode mode)
mode - | Method Detail |
|---|
public TransportFilter.Mode getMode()
TransportFilter.Mode.Stream
or TransportFilter.Mode.Message. In the TransportFilter.Mode.Stream mode,
TransportFilter produces/consumes Connection data using
FilterChainContext.getStreamReader(), FilterChainContext.getStreamWriter().
In the TransportFilter.Mode.Message mode, TransportFilter represents Connection
data as Buffer, using FilterChainContext#getMessage(},
FilterChainContext#setMessage().
public NextAction handleAccept(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific transport
filter.
handleAccept in interface FilterhandleAccept in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction handleConnect(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific transport
filter.
handleConnect in interface FilterhandleConnect in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction handleRead(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific transport
filter.
handleRead in interface FilterhandleRead in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction handleWrite(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific transport
filter.
handleWrite in interface FilterhandleWrite in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction handleClose(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific transport
filter.
handleClose in interface FilterhandleClose in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction postAccept(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific
transport filter.
postAccept in interface FilterpostAccept in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction postConnect(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific
transport filter.
postConnect in interface FilterpostConnect in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction postRead(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific
transport filter.
postRead in interface FilterpostRead in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction postWrite(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific
transport filter.
postWrite in interface FilterpostWrite in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOException
public NextAction postClose(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Transport's specific
transport filter.
postClose in interface FilterpostClose in class FilterAdapterctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
IOExceptionprotected Filter getTransportFilter0(Transport transport)
Transport specific transport filter.
transport - Transport.
Transport specific transport filter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||