【Mina】Filter--1

filter: 在IoService和IoHandler之间进行处理,类似于Web的Servlet Filter

 

一些自带的Filter:

  • LoggingFilter logs all events and requests.
  • ProtocolCodecFilter converts an incoming ByteBuffer into message POJO and vice versa.
  • CompressionFilter compresses all data.
  • SSLFilter adds SSL - TLS - StartTLS support.
  • and many more!

Filters already present

Filter class Description
Blacklist BlacklistFilter Blocks connections from blacklisted remote addresses
Buffered Write BufferedWriteFilter Buffers outgoing requests like the BufferedOutputStream does
Compression CompressionFilter  
ConnectionThrottle ConnectionThrottleFilter  
ErrorGenerating ErrorGeneratingFilter  
Executor ExecutorFilter  
FileRegionWrite FileRegionWriteFilter  
KeepAlive KeepAliveFilter  
Logging LoggingFilter Logs event messages, like MessageReceived, MessageSent, SessionOpened, ...
MDC Injection MdcInjectionFilter Inject key IoSession properties into the MDC
Noop NoopFilter A filter that does nothing. Useful for tests.
Profiler ProfilerTimerFilter Profile event messages, like MessageReceived, MessageSent, SessionOpened, ...
ProtocolCodec ProtocolCodecFilter A filter in charge of encoding and decoding messages
Proxy ProxyFilter  
Reference counting ReferenceCountingFilter Keeps track of the number of usages of this filter
RequestResponse RequestResponseFilter  
SessionAttributeInitializing SessionAttributeInitializingFilter  
StreamWrite StreamWriteFilter  
SslFilter SslFilter  
WriteRequest WriteRequestFilter  


【Mina】Filter--1




 

 

你可能感兴趣的:(Mina)