Package org.apache.mina.filter.util
Class CommonEventFilter
- java.lang.Object
-
- org.apache.mina.core.filterchain.IoFilterAdapter
-
- org.apache.mina.filter.util.CommonEventFilter
-
- All Implemented Interfaces:
IoFilter
- Direct Known Subclasses:
MdcInjectionFilter
public abstract class CommonEventFilter extends IoFilterAdapter
Extend this class when you want to create a filter that wraps the same logic around all 11 IoEvents- Author:
- Apache MINA Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter
IoFilter.NextFilter
-
-
Constructor Summary
Constructors Constructor Description CommonEventFilter()
-
Method Summary
-
Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter
destroy, init, onPostAdd, onPostRemove, onPreAdd, onPreRemove, toString
-
-
-
-
Method Detail
-
filter
protected abstract void filter(IoFilterEvent event) throws Exception
- Throws:
Exception
-
event
public void event(IoFilter.NextFilter nextFilter, IoSession session, FilterEvent event) throws Exception
Propagate an event up to theIoHandler
- Specified by:
event
in interfaceIoFilter
- Overrides:
event
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has to process this invocationevent
- The event to propagate- Throws:
Exception
- If an error occurred while processing the event
-
exceptionCaught
public final void exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, Throwable cause) throws Exception
FiltersIoHandler.exceptionCaught(IoSession,Throwable)
event.- Specified by:
exceptionCaught
in interfaceIoFilter
- Overrides:
exceptionCaught
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this eventcause
- The exception that cause this event to be received- Throws:
Exception
- If an error occurred while processing the event
-
filterClose
public final void filterClose(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
FiltersIoSession.closeNow()
or aIoSession.closeOnFlush()
method invocations.- Specified by:
filterClose
in interfaceIoFilter
- Overrides:
filterClose
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has to process this method invocation- Throws:
Exception
- If an error occurred while processing the event
-
filterWrite
public final void filterWrite(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
FiltersIoSession.write(Object)
method invocation.- Specified by:
filterWrite
in interfaceIoFilter
- Overrides:
filterWrite
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has to process this invocationwriteRequest
- TheWriteRequest
to process- Throws:
Exception
- If an error occurred while processing the event
-
inputClosed
public void inputClosed(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
FiltersIoHandler.inputClosed(IoSession)
event.- Specified by:
inputClosed
in interfaceIoFilter
- Overrides:
inputClosed
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this event- Throws:
Exception
- If an error occurred while processing the event
-
messageReceived
public final void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message) throws Exception
FiltersIoHandler.messageReceived(IoSession,Object)
event.- Specified by:
messageReceived
in interfaceIoFilter
- Overrides:
messageReceived
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this eventmessage
- The received message- Throws:
Exception
- If an error occurred while processing the event
-
messageSent
public final void messageSent(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
FiltersIoHandler.messageSent(IoSession,Object)
event.- Specified by:
messageSent
in interfaceIoFilter
- Overrides:
messageSent
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this eventwriteRequest
- TheWriteRequest
that contains the sent message- Throws:
Exception
- If an error occurred while processing the event
-
sessionClosed
public final void sessionClosed(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
FiltersIoHandler.sessionClosed(IoSession)
event.- Specified by:
sessionClosed
in interfaceIoFilter
- Overrides:
sessionClosed
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this event- Throws:
Exception
- If an error occurred while processing the event
-
sessionCreated
public final void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
FiltersIoHandler.sessionCreated(IoSession)
event.- Specified by:
sessionCreated
in interfaceIoFilter
- Overrides:
sessionCreated
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this event- Throws:
Exception
- If an error occurred while processing the event
-
sessionIdle
public final void sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception
FiltersIoHandler.sessionIdle(IoSession,IdleStatus)
event.- Specified by:
sessionIdle
in interfaceIoFilter
- Overrides:
sessionIdle
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this eventstatus
- TheIdleStatus
type- Throws:
Exception
- If an error occurred while processing the event
-
sessionOpened
public final void sessionOpened(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
FiltersIoHandler.sessionOpened(IoSession)
event.- Specified by:
sessionOpened
in interfaceIoFilter
- Overrides:
sessionOpened
in classIoFilterAdapter
- Parameters:
nextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.session
- TheIoSession
which has received this event- Throws:
Exception
- If an error occurred while processing the event
-
-