Package org.apache.mina.common
Interface IoFilterChain
-
- All Known Implementing Classes:
AbstractIoFilterChain
,VmPipeFilterChain
public interface IoFilterChain
A container ofIoFilter
s that forwardsIoHandler
events to the consisting filters and terminalIoHandler
sequentially. EveryIoSession
has its ownIoFilterChain
(1-to-1 relationship).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IoFilterChain.Entry
Represents a name-filter pair that anIoFilterChain
contains.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAfter(java.lang.String baseName, java.lang.String name, IoFilter filter)
Adds the specified filter with the specified name just after the filter whose name isbaseName
in this chain.void
addBefore(java.lang.String baseName, java.lang.String name, IoFilter filter)
Adds the specified filter with the specified name just before the filter whose name isbaseName
in this chain.void
addFirst(java.lang.String name, IoFilter filter)
Adds the specified filter with the specified name at the beginning of this chain.void
addLast(java.lang.String name, IoFilter filter)
Adds the specified filter with the specified name at the end of this chain.void
clear()
Removes all filters added to this chain.boolean
contains(java.lang.Class<? extends IoFilter> filterType)
Returns true if this chain contains anIoFilter
of the specified filterType.boolean
contains(java.lang.String name)
Returns true if this chain contains anIoFilter
with the specified name.boolean
contains(IoFilter filter)
Returns true if this chain contains the specified filter.void
fireExceptionCaught(IoSession session, java.lang.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, java.lang.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.IoFilter
get(java.lang.String name)
Returns theIoFilter
with the specified name in this chain.java.util.List<IoFilterChain.Entry>
getAll()
Returns the list of allIoFilterChain.Entry
s this chain contains.java.util.List<IoFilterChain.Entry>
getAllReversed()
Returns the reversed list of allIoFilterChain.Entry
s this chain contains.IoFilterChain.Entry
getEntry(java.lang.String name)
Returns theIoFilterChain.Entry
with the specified name in this chain.IoFilter.NextFilter
getNextFilter(java.lang.String name)
Returns theIoFilter.NextFilter
of theIoFilter
with the specified name in this chain.IoSession
getSession()
Returns the parentIoSession
of this chain.IoFilter
remove(java.lang.String name)
Removes the filter with the specified name from this chain.
-
-
-
Method Detail
-
getEntry
IoFilterChain.Entry getEntry(java.lang.String name)
Returns theIoFilterChain.Entry
with the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
get
IoFilter get(java.lang.String name)
Returns theIoFilter
with the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
getNextFilter
IoFilter.NextFilter getNextFilter(java.lang.String name)
Returns theIoFilter.NextFilter
of theIoFilter
with the specified name in this chain.- Returns:
- null if there's no such name in this chain
-
getAll
java.util.List<IoFilterChain.Entry> getAll()
Returns the list of allIoFilterChain.Entry
s this chain contains.
-
getAllReversed
java.util.List<IoFilterChain.Entry> getAllReversed()
Returns the reversed list of allIoFilterChain.Entry
s this chain contains.
-
contains
boolean contains(java.lang.String name)
Returns true if this chain contains anIoFilter
with the specified name.
-
contains
boolean contains(IoFilter filter)
Returns true if this chain contains the specified filter.
-
contains
boolean contains(java.lang.Class<? extends IoFilter> filterType)
Returns true if this chain contains anIoFilter
of the specified filterType.
-
addFirst
void addFirst(java.lang.String name, IoFilter filter)
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
void addLast(java.lang.String name, IoFilter filter)
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
void addBefore(java.lang.String baseName, java.lang.String name, IoFilter filter)
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
void addAfter(java.lang.String baseName, java.lang.String name, IoFilter filter)
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
IoFilter remove(java.lang.String name)
Removes the filter with the specified name from this chain.- Throws:
IoFilterLifeCycleException
- ifIoFilter.onPostRemove(IoFilterChain, String, NextFilter)
orIoFilter.destroy()
throws an exception.
-
clear
void clear() throws java.lang.Exception
Removes all filters added to this chain.- Throws:
java.lang.Exception
- ifIoFilter.onPostRemove(IoFilterChain, String, NextFilter)
thrown an exception.
-
fireSessionCreated
void fireSessionCreated(IoSession session)
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
void fireSessionOpened(IoSession session)
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
void fireSessionClosed(IoSession session)
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
void fireSessionIdle(IoSession session, IdleStatus status)
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
void fireMessageReceived(IoSession session, java.lang.Object message)
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
void fireMessageSent(IoSession session, IoFilter.WriteRequest request)
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
void fireExceptionCaught(IoSession session, java.lang.Throwable cause)
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
void fireFilterWrite(IoSession session, IoFilter.WriteRequest writeRequest)
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
void fireFilterClose(IoSession session)
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.
-
-