|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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 | |
|---|---|
static interface |
IoFilterChain.Entry
Represents a name-filter pair that an IoFilterChain contains. |
| Method Summary | |
|---|---|
void |
addAfter(String baseName,
String name,
IoFilter filter)
Adds the specified filter with the specified name just after the filter whose name is baseName in this chain. |
void |
addBefore(String baseName,
String name,
IoFilter filter)
Adds the specified filter with the specified name just before the filter whose name is baseName in this chain. |
void |
addFirst(String name,
IoFilter filter)
Adds the specified filter with the specified name at the beginning of this chain. |
void |
addLast(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(Class<? extends IoFilter> filterType)
Returns true if this chain contains an IoFilter of the
specified filterType. |
boolean |
contains(IoFilter filter)
Returns true if this chain contains the specified filter. |
boolean |
contains(String name)
Returns true if this chain contains an IoFilter with the
specified name. |
void |
fireExceptionCaught(Throwable cause)
Fires a IoHandler.exceptionCaught(IoSession, Throwable) event. |
void |
fireFilterClose()
Fires a IoSession.close() event. |
void |
fireFilterWrite(WriteRequest writeRequest)
Fires a IoSession.write(Object) event. |
void |
fireMessageReceived(Object message)
Fires a fireMessageReceived(Object) event. |
void |
fireMessageSent(WriteRequest request)
Fires a IoHandler.sessionOpened(IoSession) event. |
void |
fireSessionClosed()
Fires a IoHandler.sessionClosed(IoSession) event. |
void |
fireSessionCreated()
Fires a IoHandler.sessionCreated(IoSession) event. |
void |
fireSessionIdle(IdleStatus status)
Fires a IoHandler.sessionIdle(IoSession, IdleStatus) event. |
void |
fireSessionOpened()
Fires a IoHandler.sessionOpened(IoSession) event. |
IoFilter |
get(Class<? extends IoFilter> filterType)
Returns the IoFilter with the specified filterType
in this chain. |
IoFilter |
get(String name)
Returns the IoFilter with the specified name in this chain. |
List<IoFilterChain.Entry> |
getAll()
Returns the list of all IoFilterChain.Entrys this chain contains. |
List<IoFilterChain.Entry> |
getAllReversed()
Returns the reversed list of all IoFilterChain.Entrys this chain contains. |
IoFilterChain.Entry |
getEntry(Class<? extends IoFilter> filterType)
Returns the IoFilterChain.Entry with the specified filterType
in this chain. |
IoFilterChain.Entry |
getEntry(IoFilter filter)
Returns the IoFilterChain.Entry with the specified filter in this chain. |
IoFilterChain.Entry |
getEntry(String name)
Returns the IoFilterChain.Entry with the specified name in this chain. |
IoFilter.NextFilter |
getNextFilter(Class<? extends IoFilter> filterType)
Returns the IoFilter.NextFilter of the specified filterType
in this chain. |
IoFilter.NextFilter |
getNextFilter(IoFilter filter)
Returns the IoFilter.NextFilter of the specified IoFilter
in this chain. |
IoFilter.NextFilter |
getNextFilter(String name)
Returns the IoFilter.NextFilter of the IoFilter with the
specified name in this chain. |
IoSession |
getSession()
Returns the parent IoSession of this chain. |
IoFilter |
remove(Class<? extends IoFilter> filterType)
Replace the filter of the specified type with the specified new filter. |
void |
remove(IoFilter filter)
Replace the filter with the specified name with the specified new filter. |
IoFilter |
remove(String name)
Removes the filter with the specified name from this chain. |
IoFilter |
replace(Class<? extends IoFilter> oldFilterType,
IoFilter newFilter)
Replace the filter of the specified type with the specified new filter. |
void |
replace(IoFilter oldFilter,
IoFilter newFilter)
Replace the filter with the specified name with the specified new filter. |
IoFilter |
replace(String name,
IoFilter newFilter)
Replace the filter with the specified name with the specified new filter. |
| Method Detail |
|---|
IoSession getSession()
IoSession of this chain.
IoSessionIoFilterChain.Entry getEntry(String name)
IoFilterChain.Entry with the specified name in this chain.
IoFilterChain.Entry getEntry(IoFilter filter)
IoFilterChain.Entry with the specified filter in this chain.
IoFilterChain.Entry getEntry(Class<? extends IoFilter> filterType)
IoFilterChain.Entry with the specified filterType
in this chain. If there's more than one filter with the specified
type, the first match will be chosen.
IoFilter get(String name)
IoFilter with the specified name in this chain.
IoFilter get(Class<? extends IoFilter> filterType)
IoFilter with the specified filterType
in this chain. If there's more than one filter with the specified
type, the first match will be chosen.
IoFilter.NextFilter getNextFilter(String name)
IoFilter.NextFilter of the IoFilter with the
specified name in this chain.
IoFilter.NextFilter getNextFilter(IoFilter filter)
IoFilter.NextFilter of the specified IoFilter
in this chain.
IoFilter.NextFilter getNextFilter(Class<? extends IoFilter> filterType)
IoFilter.NextFilter of the specified filterType
in this chain. If there's more than one filter with the specified
type, the first match will be chosen.
List<IoFilterChain.Entry> getAll()
IoFilterChain.Entrys this chain contains.
List<IoFilterChain.Entry> getAllReversed()
IoFilterChain.Entrys this chain contains.
boolean contains(String name)
IoFilter with the
specified name.
boolean contains(IoFilter filter)
boolean contains(Class<? extends IoFilter> filterType)
IoFilter of the
specified filterType.
void addFirst(String name,
IoFilter filter)
IoFilterLifeCycleException - if IoFilter.onPostAdd(IoFilterChain, String, NextFilter) or
IoFilter.init() throws an exception.
void addLast(String name,
IoFilter filter)
IoFilterLifeCycleException - if IoFilter.onPostAdd(IoFilterChain, String, NextFilter) or
IoFilter.init() throws an exception.
void addBefore(String baseName,
String name,
IoFilter filter)
baseName in this chain.
IoFilterLifeCycleException - if IoFilter.onPostAdd(IoFilterChain, String, NextFilter) or
IoFilter.init() throws an exception.
void addAfter(String baseName,
String name,
IoFilter filter)
baseName in this chain.
IoFilterLifeCycleException - if IoFilter.onPostAdd(IoFilterChain, String, NextFilter) or
IoFilter.init() throws an exception.
IoFilter replace(String name,
IoFilter newFilter)
IllegalArgumentException - if there's no such filter
void replace(IoFilter oldFilter,
IoFilter newFilter)
IllegalArgumentException - if there's no such filter
IoFilter replace(Class<? extends IoFilter> oldFilterType,
IoFilter newFilter)
IllegalArgumentException - if there's no such filterIoFilter remove(String name)
IoFilterLifeCycleException - if IoFilter.onPostRemove(IoFilterChain, String, NextFilter) or
IoFilter.destroy() throws an exception.void remove(IoFilter filter)
IllegalArgumentException - if there's no such filterIoFilter remove(Class<? extends IoFilter> filterType)
IllegalArgumentException - if there's no such filter
void clear()
throws Exception
Exception - if IoFilter.onPostRemove(IoFilterChain, String, NextFilter) thrown an exception.void fireSessionCreated()
IoHandler.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.
void fireSessionOpened()
IoHandler.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.
void fireSessionClosed()
IoHandler.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.
void fireSessionIdle(IdleStatus status)
IoHandler.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.
void fireMessageReceived(Object message)
fireMessageReceived(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.
void fireMessageSent(WriteRequest request)
IoHandler.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.
void fireExceptionCaught(Throwable cause)
IoHandler.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.
void fireFilterWrite(WriteRequest writeRequest)
IoSession.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.
void fireFilterClose()
IoSession.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||