public interface IoFilterChain
IoFilter
s that forwards IoHandler
events
to the consisting filters and terminal IoHandler
sequentially.
Every IoSession
has its own IoFilterChain
(1-to-1 relationship).Modifier and Type | Interface and Description |
---|---|
static interface |
IoFilterChain.Entry
Represents a name-filter pair that an
IoFilterChain contains. |
Modifier and Type | Method and 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 is
baseName 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 is
baseName 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) |
boolean |
contains(IoFilter filter) |
boolean |
contains(java.lang.String name) |
void |
fireExceptionCaught(java.lang.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(java.lang.Object message)
Fires a
IoHandler#messageReceived(Object) event. |
void |
fireMessageSent(WriteRequest request)
Fires a
IoHandler#messageSent(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(java.lang.Class<? extends IoFilter> filterType)
Returns the
IoFilter with the specified filterType
in this chain. |
IoFilter |
get(java.lang.String name)
Returns the
IoFilter with the specified name in this chain. |
java.util.List<IoFilterChain.Entry> |
getAll() |
java.util.List<IoFilterChain.Entry> |
getAllReversed() |
IoFilterChain.Entry |
getEntry(java.lang.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(java.lang.String name)
Returns the
IoFilterChain.Entry with the specified name in this chain. |
IoFilter.NextFilter |
getNextFilter(java.lang.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(java.lang.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(java.lang.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(java.lang.String name)
Removes the filter with the specified name from this chain.
|
IoFilter |
replace(java.lang.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(java.lang.String name,
IoFilter newFilter)
Replace the filter with the specified name with the specified new
filter.
|
IoFilterChain.Entry getEntry(java.lang.String name)
IoFilterChain.Entry
with the specified name in this chain.name
- The filter's name we are looking forIoFilterChain.Entry getEntry(IoFilter filter)
IoFilterChain.Entry
with the specified filter in this chain.filter
- The Filter we are looking forIoFilterChain.Entry getEntry(java.lang.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.filterType
- The filter class we are looking forIoFilter get(java.lang.String name)
IoFilter
with the specified name in this chain.name
- the filter's nameIoFilter get(java.lang.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.filterType
- The filter classIoFilter.NextFilter getNextFilter(java.lang.String name)
IoFilter.NextFilter
of the IoFilter
with the
specified name in this chain.name
- The filter's name we want the next filterIoFilter.NextFilter getNextFilter(IoFilter filter)
IoFilter.NextFilter
of the specified IoFilter
in this chain.filter
- The filter for which we want the next filterIoFilter.NextFilter getNextFilter(java.lang.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.filterType
- The Filter class for which we want the next filterjava.util.List<IoFilterChain.Entry> getAll()
IoFilterChain.Entry
s this chain contains.java.util.List<IoFilterChain.Entry> getAllReversed()
IoFilterChain.Entry
s this chain contains.boolean contains(java.lang.String name)
name
- The filter's name we are looking forIoFilter
with the
specified name.boolean contains(IoFilter filter)
filter
- The filter we are looking forboolean contains(java.lang.Class<? extends IoFilter> filterType)
filterType
- The filter's class we are looking forIoFilter
of the
specified filterType.void addFirst(java.lang.String name, IoFilter filter)
name
- The filter's namefilter
- The filter to addvoid addLast(java.lang.String name, IoFilter filter)
name
- The filter's namefilter
- The filter to addvoid addBefore(java.lang.String baseName, java.lang.String name, IoFilter filter)
baseName
in this chain.baseName
- The targeted Filter's namename
- The filter's namefilter
- The filter to addvoid addAfter(java.lang.String baseName, java.lang.String name, IoFilter filter)
baseName
in this chain.baseName
- The targeted Filter's namename
- The filter's namefilter
- The filter to addIoFilter replace(java.lang.String name, IoFilter newFilter)
name
- The name of the filter we want to replacenewFilter
- The new filtervoid replace(IoFilter oldFilter, IoFilter newFilter)
oldFilter
- The filter we want to replacenewFilter
- The new filterIoFilter replace(java.lang.Class<? extends IoFilter> oldFilterType, IoFilter newFilter)
oldFilterType
- The filter class we want to replacenewFilter
- The new filterIoFilter remove(java.lang.String name)
name
- The name of the filter to removevoid remove(IoFilter filter)
name
- The filter to removeIoFilter remove(java.lang.Class<? extends IoFilter> filterType)
name
- The filter class to removevoid clear() throws java.lang.Exception
java.lang.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.status
- The current status to propagatevoid fireMessageReceived(java.lang.Object message)
IoHandler#messageReceived(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.message
- The received messagevoid fireMessageSent(WriteRequest request)
IoHandler#messageSent(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.request
- The sent requestvoid fireExceptionCaught(java.lang.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.cause
- The exception causevoid 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.writeRequest
- The message to writevoid 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.Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.