Package org.apache.mina.common
Interface IoFilterChain
- All Known Implementing Classes:
AbstractIoFilterChain,VmPipeFilterChain
public interface IoFilterChain
A container of
IoFilters that forwards IoHandler events
to the consisting filters and terminal IoHandler sequentially.
Every IoSession has its own IoFilterChain (1-to-1 relationship).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a name-filter pair that anIoFilterChaincontains. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified filter with the specified name just after the filter whose name isbaseNamein this chain.voidAdds the specified filter with the specified name just before the filter whose name isbaseNamein this chain.voidAdds the specified filter with the specified name at the beginning of this chain.voidAdds the specified filter with the specified name at the end of this chain.voidclear()Removes all filters added to this chain.booleanReturns true if this chain contains anIoFilterof the specified filterType.booleanReturns true if this chain contains anIoFilterwith the specified name.booleanReturns true if this chain contains the specified filter.voidfireExceptionCaught(IoSession session, Throwable cause) Fires aIoHandler.exceptionCaught(IoSession, Throwable)event.voidfireFilterClose(IoSession session) Fires aIoSession.close()event.voidfireFilterWrite(IoSession session, IoFilter.WriteRequest writeRequest) Fires aIoSession.write(Object)event.voidfireMessageReceived(IoSession session, Object message) Fires afireMessageReceived(IoSession, Object)event.voidfireMessageSent(IoSession session, IoFilter.WriteRequest request) Fires aIoHandler.sessionOpened(IoSession)event.voidfireSessionClosed(IoSession session) Fires aIoHandler.sessionClosed(IoSession)event.voidfireSessionCreated(IoSession session) Fires aIoHandler.sessionCreated(IoSession)event.voidfireSessionIdle(IoSession session, IdleStatus status) Fires aIoHandler.sessionIdle(IoSession, IdleStatus)event.voidfireSessionOpened(IoSession session) Fires aIoHandler.sessionOpened(IoSession)event.Returns theIoFilterwith the specified name in this chain.getAll()Returns the list of allIoFilterChain.Entrys this chain contains.Returns the reversed list of allIoFilterChain.Entrys this chain contains.Returns theIoFilterChain.Entrywith the specified name in this chain.getNextFilter(String name) Returns theIoFilter.NextFilterof theIoFilterwith the specified name in this chain.Returns the parentIoSessionof this chain.Removes the filter with the specified name from this chain.
-
Method Details
-
getSession
IoSession getSession()Returns the parentIoSessionof this chain.- Returns:
IoSession
-
getEntry
Returns theIoFilterChain.Entrywith the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
get
Returns theIoFilterwith the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
getNextFilter
Returns theIoFilter.NextFilterof theIoFilterwith the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
getAll
List<IoFilterChain.Entry> getAll()Returns the list of allIoFilterChain.Entrys this chain contains. -
getAllReversed
List<IoFilterChain.Entry> getAllReversed()Returns the reversed list of allIoFilterChain.Entrys this chain contains. -
contains
Returns true if this chain contains anIoFilterwith the specified name. -
contains
Returns true if this chain contains the specified filter. -
contains
Returns true if this chain contains anIoFilterof the specified filterType. -
addFirst
Adds the specified filter with the specified name at the beginning of this chain.- Throws:
IoFilterLifeCycleException- ifIoFilter.onPostAdd(IoFilterChain, String, NextFilter)orIoFilter.init()throws an exception.
-
addLast
Adds the specified filter with the specified name at the end of this chain.- Throws:
IoFilterLifeCycleException- ifIoFilter.onPostAdd(IoFilterChain, String, NextFilter)orIoFilter.init()throws an exception.
-
addBefore
Adds the specified filter with the specified name just before the filter whose name isbaseNamein this chain.- Throws:
IoFilterLifeCycleException- ifIoFilter.onPostAdd(IoFilterChain, String, NextFilter)orIoFilter.init()throws an exception.
-
addAfter
Adds the specified filter with the specified name just after the filter whose name isbaseNamein this chain.- Throws:
IoFilterLifeCycleException- ifIoFilter.onPostAdd(IoFilterChain, String, NextFilter)orIoFilter.init()throws an exception.
-
remove
Removes the filter with the specified name from this chain.- Throws:
IoFilterLifeCycleException- ifIoFilter.onPostRemove(IoFilterChain, String, NextFilter)orIoFilter.destroy()throws an exception.
-
clear
Removes all filters added to this chain.- Throws:
Exception- ifIoFilter.onPostRemove(IoFilterChain, String, NextFilter)thrown an exception.
-
fireSessionCreated
Fires aIoHandler.sessionCreated(IoSession)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireSessionOpened
Fires aIoHandler.sessionOpened(IoSession)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireSessionClosed
Fires aIoHandler.sessionClosed(IoSession)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireSessionIdle
Fires aIoHandler.sessionIdle(IoSession, IdleStatus)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireMessageReceived
Fires afireMessageReceived(IoSession, Object)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireMessageSent
Fires aIoHandler.sessionOpened(IoSession)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireExceptionCaught
Fires aIoHandler.exceptionCaught(IoSession, Throwable)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireFilterWrite
Fires aIoSession.write(Object)event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event. -
fireFilterClose
Fires aIoSession.close()event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.
-