Package org.apache.mina.common
Interface IoFilterChain
-
- All Known Implementing Classes:
AbstractIoFilterChain,VmPipeFilterChain
public interface IoFilterChainA container ofIoFilters that forwardsIoHandlerevents to the consisting filters and terminalIoHandlersequentially. EveryIoSessionhas its ownIoFilterChain(1-to-1 relationship).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIoFilterChain.EntryRepresents a name-filter pair that anIoFilterChaincontains.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAfter(java.lang.String baseName, java.lang.String name, IoFilter filter)Adds the specified filter with the specified name just after the filter whose name isbaseNamein this chain.voidaddBefore(java.lang.String baseName, java.lang.String name, IoFilter filter)Adds the specified filter with the specified name just before the filter whose name isbaseNamein this chain.voidaddFirst(java.lang.String name, IoFilter filter)Adds the specified filter with the specified name at the beginning of this chain.voidaddLast(java.lang.String name, IoFilter filter)Adds the specified filter with the specified name at the end of this chain.voidclear()Removes all filters added to this chain.booleancontains(java.lang.Class<? extends IoFilter> filterType)Returns true if this chain contains anIoFilterof the specified filterType.booleancontains(java.lang.String name)Returns true if this chain contains anIoFilterwith the specified name.booleancontains(IoFilter filter)Returns true if this chain contains the specified filter.voidfireExceptionCaught(IoSession session, java.lang.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, java.lang.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.IoFilterget(java.lang.String name)Returns theIoFilterwith the specified name in this chain.java.util.List<IoFilterChain.Entry>getAll()Returns the list of allIoFilterChain.Entrys this chain contains.java.util.List<IoFilterChain.Entry>getAllReversed()Returns the reversed list of allIoFilterChain.Entrys this chain contains.IoFilterChain.EntrygetEntry(java.lang.String name)Returns theIoFilterChain.Entrywith the specified name in this chain.IoFilter.NextFiltergetNextFilter(java.lang.String name)Returns theIoFilter.NextFilterof theIoFilterwith the specified name in this chain.IoSessiongetSession()Returns the parentIoSessionof this chain.IoFilterremove(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.Entrywith 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 theIoFilterwith 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.NextFilterof theIoFilterwith 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.Entrys this chain contains.
-
getAllReversed
java.util.List<IoFilterChain.Entry> getAllReversed()
Returns the reversed list of allIoFilterChain.Entrys this chain contains.
-
contains
boolean contains(java.lang.String name)
Returns true if this chain contains anIoFilterwith 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 anIoFilterof 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 isbaseNamein 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 isbaseNamein 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.ExceptionRemoves 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.
-
-