|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.filterchain.DefaultIoFilterChain
public class DefaultIoFilterChain
A default implementation of IoFilterChain
that provides
all operations for developers who want to implement their own
transport layer once used with AbstractIoSession
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilterChain |
---|
IoFilterChain.Entry |
Field Summary | |
---|---|
static AttributeKey |
SESSION_CREATED_FUTURE
A session attribute that stores an IoFuture related with
the IoSession . |
Constructor Summary | |
---|---|
DefaultIoFilterChain(AbstractIoSession session)
Create a new default chain, associated with a session. |
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)
|
boolean |
contains(IoFilter filter)
|
boolean |
contains(String 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 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(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()
|
List<IoFilterChain.Entry> |
getAllReversed()
|
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final AttributeKey SESSION_CREATED_FUTURE
IoFuture
related with
the IoSession
. DefaultIoFilterChain
clears this
attribute and notifies the future when fireSessionCreated()
or fireExceptionCaught(Throwable)
is invoked.
Constructor Detail |
---|
public DefaultIoFilterChain(AbstractIoSession session)
session
- The session associated with the created filter chainMethod Detail |
---|
public IoSession getSession()
IoFilterChain
IoSession
of this chain.
getSession
in interface IoFilterChain
IoSession
public IoFilterChain.Entry getEntry(String name)
IoFilterChain
IoFilterChain.Entry
with the specified name in this chain.
getEntry
in interface IoFilterChain
name
- The filter's name we are looking for
public IoFilterChain.Entry getEntry(IoFilter filter)
IoFilterChain
IoFilterChain.Entry
with the specified filter in this chain.
getEntry
in interface IoFilterChain
filter
- The Filter we are looking for
public IoFilterChain.Entry getEntry(Class<? extends IoFilter> filterType)
IoFilterChain
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.
getEntry
in interface IoFilterChain
filterType
- The filter class we are looking for
public IoFilter get(String name)
IoFilterChain
IoFilter
with the specified name in this chain.
get
in interface IoFilterChain
name
- the filter's name
public IoFilter get(Class<? extends IoFilter> filterType)
IoFilterChain
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.
get
in interface IoFilterChain
filterType
- The filter class
public IoFilter.NextFilter getNextFilter(String name)
IoFilterChain
IoFilter.NextFilter
of the IoFilter
with the
specified name in this chain.
getNextFilter
in interface IoFilterChain
name
- The filter's name we want the next filter
public IoFilter.NextFilter getNextFilter(IoFilter filter)
IoFilterChain
IoFilter.NextFilter
of the specified IoFilter
in this chain.
getNextFilter
in interface IoFilterChain
filter
- The filter for which we want the next filter
public IoFilter.NextFilter getNextFilter(Class<? extends IoFilter> filterType)
IoFilterChain
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.
getNextFilter
in interface IoFilterChain
filterType
- The Filter class for which we want the next filter
public void addFirst(String name, IoFilter filter)
IoFilterChain
addFirst
in interface IoFilterChain
name
- The filter's namefilter
- The filter to addpublic void addLast(String name, IoFilter filter)
IoFilterChain
addLast
in interface IoFilterChain
name
- The filter's namefilter
- The filter to addpublic void addBefore(String baseName, String name, IoFilter filter)
IoFilterChain
baseName
in this chain.
addBefore
in interface IoFilterChain
baseName
- The targeted Filter's namename
- The filter's namefilter
- The filter to addpublic void addAfter(String baseName, String name, IoFilter filter)
IoFilterChain
baseName
in this chain.
addAfter
in interface IoFilterChain
baseName
- The targeted Filter's namename
- The filter's namefilter
- The filter to addpublic IoFilter remove(String name)
IoFilterChain
remove
in interface IoFilterChain
name
- The name of the filter to remove
public void remove(IoFilter filter)
IoFilterChain
remove
in interface IoFilterChain
public IoFilter remove(Class<? extends IoFilter> filterType)
IoFilterChain
remove
in interface IoFilterChain
public IoFilter replace(String name, IoFilter newFilter)
IoFilterChain
replace
in interface IoFilterChain
name
- The name of the filter we want to replacenewFilter
- The new filter
public void replace(IoFilter oldFilter, IoFilter newFilter)
IoFilterChain
replace
in interface IoFilterChain
oldFilter
- The filter we want to replacenewFilter
- The new filterpublic IoFilter replace(Class<? extends IoFilter> oldFilterType, IoFilter newFilter)
IoFilterChain
replace
in interface IoFilterChain
oldFilterType
- The filter class we want to replacenewFilter
- The new filterpublic void clear() throws Exception
IoFilterChain
clear
in interface IoFilterChain
Exception
public void fireSessionCreated()
IoFilterChain
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.
fireSessionCreated
in interface IoFilterChain
public void fireSessionOpened()
IoFilterChain
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.
fireSessionOpened
in interface IoFilterChain
public void fireSessionClosed()
IoFilterChain
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.
fireSessionClosed
in interface IoFilterChain
public void fireSessionIdle(IdleStatus status)
IoFilterChain
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.
fireSessionIdle
in interface IoFilterChain
status
- The current status to propagatepublic void fireMessageReceived(Object message)
IoFilterChain
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.
fireMessageReceived
in interface IoFilterChain
message
- The received messagepublic void fireMessageSent(WriteRequest request)
IoFilterChain
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.
fireMessageSent
in interface IoFilterChain
request
- The sent requestpublic void fireExceptionCaught(Throwable cause)
IoFilterChain
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.
fireExceptionCaught
in interface IoFilterChain
cause
- The exception causepublic void fireFilterWrite(WriteRequest writeRequest)
IoFilterChain
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.
fireFilterWrite
in interface IoFilterChain
writeRequest
- The message to writepublic void fireFilterClose()
IoFilterChain
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.
fireFilterClose
in interface IoFilterChain
public List<IoFilterChain.Entry> getAll()
getAll
in interface IoFilterChain
IoFilterChain.Entry
s this chain contains.public List<IoFilterChain.Entry> getAllReversed()
getAllReversed
in interface IoFilterChain
IoFilterChain.Entry
s this chain contains.public boolean contains(String name)
contains
in interface IoFilterChain
name
- The filter's name we are looking for
IoFilter
with the
specified name.public boolean contains(IoFilter filter)
contains
in interface IoFilterChain
filter
- The filter we are looking for
public boolean contains(Class<? extends IoFilter> filterType)
contains
in interface IoFilterChain
filterType
- The filter's class we are looking for
IoFilter
of the
specified filterType.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |