Package org.apache.mina.common
Interface IoFilterChain
- All Known Implementing Classes:
AbstractIoFilterChain
,VmPipeFilterChain
public interface IoFilterChain
A container of
IoFilter
s 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 interface
Represents a name-filter pair that anIoFilterChain
contains. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified filter with the specified name just after the filter whose name isbaseName
in this chain.void
Adds the specified filter with the specified name just before the filter whose name isbaseName
in this chain.void
Adds the specified filter with the specified name at the beginning of this chain.void
Adds the specified filter with the specified name at the end of this chain.void
clear()
Removes all filters added to this chain.boolean
Returns true if this chain contains anIoFilter
of the specified filterType.boolean
Returns true if this chain contains anIoFilter
with the specified name.boolean
Returns true if this chain contains the specified filter.void
fireExceptionCaught
(IoSession session, Throwable cause) Fires aIoHandler.exceptionCaught(IoSession, Throwable)
event.void
fireFilterClose
(IoSession session) Fires aIoSession.close()
event.void
fireFilterWrite
(IoSession session, IoFilter.WriteRequest writeRequest) Fires aIoSession.write(Object)
event.void
fireMessageReceived
(IoSession session, Object message) Fires afireMessageReceived(IoSession, Object)
event.void
fireMessageSent
(IoSession session, IoFilter.WriteRequest request) Fires aIoHandler.sessionOpened(IoSession)
event.void
fireSessionClosed
(IoSession session) Fires aIoHandler.sessionClosed(IoSession)
event.void
fireSessionCreated
(IoSession session) Fires aIoHandler.sessionCreated(IoSession)
event.void
fireSessionIdle
(IoSession session, IdleStatus status) Fires aIoHandler.sessionIdle(IoSession, IdleStatus)
event.void
fireSessionOpened
(IoSession session) Fires aIoHandler.sessionOpened(IoSession)
event.Returns theIoFilter
with the specified name in this chain.getAll()
Returns the list of allIoFilterChain.Entry
s this chain contains.Returns the reversed list of allIoFilterChain.Entry
s this chain contains.Returns theIoFilterChain.Entry
with the specified name in this chain.getNextFilter
(String name) Returns theIoFilter.NextFilter
of theIoFilter
with the specified name in this chain.Returns the parentIoSession
of this chain.Removes the filter with the specified name from this chain.
-
Method Details
-
getSession
IoSession getSession()Returns the parentIoSession
of this chain.- Returns:
IoSession
-
getEntry
Returns theIoFilterChain.Entry
with the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
get
Returns theIoFilter
with the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
getNextFilter
Returns theIoFilter.NextFilter
of theIoFilter
with 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.Entry
s this chain contains. -
getAllReversed
List<IoFilterChain.Entry> getAllReversed()Returns the reversed list of allIoFilterChain.Entry
s this chain contains. -
contains
Returns true if this chain contains anIoFilter
with the specified name. -
contains
Returns true if this chain contains the specified filter. -
contains
Returns true if this chain contains anIoFilter
of 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 isbaseName
in 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 isbaseName
in 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.
-