|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.mina.common.support.AbstractIoFilterChain
public abstract class AbstractIoFilterChain
An abstract implementation of IoFilterChain that provides
common operations for developers to implement their own transport layer.
The only method a developer should implement is
doWrite(IoSession, IoFilter.WriteRequest). This method is invoked
when filter chain is evaluated for
IoFilter.filterWrite(NextFilter, IoSession, IoFilter.WriteRequest) and
finally to be written out.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.littleshoot.mina.common.IoFilterChain |
|---|
IoFilterChain.Entry |
| Field Summary | |
|---|---|
static String |
CONNECT_FUTURE
A session attribute that stores a ConnectFuture related with
the IoSession. |
| Constructor Summary | |
|---|---|
protected |
AbstractIoFilterChain(IoSession 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)
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. |
protected abstract void |
doClose(IoSession session)
|
protected abstract void |
doWrite(IoSession session,
IoFilter.WriteRequest writeRequest)
|
protected void |
finalize()
|
void |
fireExceptionCaught(IoSession session,
Throwable cause)
Fires a IoHandler.exceptionCaught(IoSession, Throwable) event. |
void |
fireFilterClose(IoSession session)
Fires a IoSession.close() event. |
void |
fireFilterWrite(IoSession session,
IoFilter.WriteRequest writeRequest)
Fires a IoSession.write(Object) event. |
void |
fireMessageReceived(IoSession session,
Object message)
Fires a IoFilterChain.fireMessageReceived(IoSession, Object) event. |
void |
fireMessageSent(IoSession session,
IoFilter.WriteRequest request)
Fires a IoHandler.sessionOpened(IoSession) event. |
void |
fireSessionClosed(IoSession session)
Fires a IoHandler.sessionClosed(IoSession) event. |
void |
fireSessionCreated(IoSession session)
Fires a IoHandler.sessionCreated(IoSession) event. |
void |
fireSessionIdle(IoSession session,
IdleStatus status)
Fires a IoHandler.sessionIdle(IoSession, IdleStatus) event. |
void |
fireSessionOpened(IoSession session)
Fires a IoHandler.sessionOpened(IoSession) event. |
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(String name)
Returns the IoFilterChain.Entry with the specified name 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(String name)
Removes the filter with the specified name from this chain. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String CONNECT_FUTURE
ConnectFuture related with
the IoSession. AbstractIoFilterChain clears this
attribute and notifies the future when fireSessionOpened(IoSession)
or fireExceptionCaught(IoSession, Throwable) is invoked
| Constructor Detail |
|---|
protected AbstractIoFilterChain(IoSession session)
| Method Detail |
|---|
public IoSession getSession()
IoFilterChainIoSession of this chain.
getSession in interface IoFilterChainIoSessionpublic IoFilterChain.Entry getEntry(String name)
IoFilterChainIoFilterChain.Entry with the specified name in this chain.
getEntry in interface IoFilterChainpublic IoFilter get(String name)
IoFilterChainIoFilter with the specified name in this chain.
get in interface IoFilterChainpublic IoFilter.NextFilter getNextFilter(String name)
IoFilterChainIoFilter.NextFilter of the IoFilter with the
specified name in this chain.
getNextFilter in interface IoFilterChain
public void addFirst(String name,
IoFilter filter)
IoFilterChain
addFirst in interface IoFilterChain
public void addLast(String name,
IoFilter filter)
IoFilterChain
addLast in interface IoFilterChain
public void addBefore(String baseName,
String name,
IoFilter filter)
IoFilterChainbaseName in this chain.
addBefore in interface IoFilterChain
public void addAfter(String baseName,
String name,
IoFilter filter)
IoFilterChainbaseName in this chain.
addAfter in interface IoFilterChainpublic IoFilter remove(String name)
IoFilterChain
remove in interface IoFilterChain
public void clear()
throws Exception
IoFilterChain
clear in interface IoFilterChainException - if IoFilter.onPostRemove(IoFilterChain, String, NextFilter) thrown an exception.public void fireSessionCreated(IoSession session)
IoFilterChainIoHandler.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 IoFilterChainpublic void fireSessionOpened(IoSession session)
IoFilterChainIoHandler.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 IoFilterChainpublic void fireSessionClosed(IoSession session)
IoFilterChainIoHandler.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(IoSession session,
IdleStatus status)
IoFilterChainIoHandler.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
public void fireMessageReceived(IoSession session,
Object message)
IoFilterChainIoFilterChain.fireMessageReceived(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.
fireMessageReceived in interface IoFilterChain
public void fireMessageSent(IoSession session,
IoFilter.WriteRequest request)
IoFilterChainIoHandler.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.
fireMessageSent in interface IoFilterChain
public void fireExceptionCaught(IoSession session,
Throwable cause)
IoFilterChainIoHandler.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
public void fireFilterWrite(IoSession session,
IoFilter.WriteRequest writeRequest)
IoFilterChainIoSession.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 IoFilterChainpublic void fireFilterClose(IoSession session)
IoFilterChainIoSession.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 IoFilterChainpublic List<IoFilterChain.Entry> getAll()
IoFilterChainIoFilterChain.Entrys this chain contains.
getAll in interface IoFilterChainpublic List<IoFilterChain.Entry> getAllReversed()
IoFilterChainIoFilterChain.Entrys this chain contains.
getAllReversed in interface IoFilterChainpublic boolean contains(String name)
IoFilterChainIoFilter with the
specified name.
contains in interface IoFilterChainpublic boolean contains(IoFilter filter)
IoFilterChain
contains in interface IoFilterChainpublic boolean contains(Class<? extends IoFilter> filterType)
IoFilterChainIoFilter of the
specified filterType.
contains in interface IoFilterChainpublic String toString()
toString in class Object
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected abstract void doWrite(IoSession session,
IoFilter.WriteRequest writeRequest)
throws Exception
Exception
protected abstract void doClose(IoSession session)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||