|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.core.filterchain.IoFilterAdapter
org.apache.mina.filter.util.ReferenceCountingFilter
public class ReferenceCountingFilter
An IoFilters wrapper that keeps track of the number of usages of this filter and will call init/destroy
when the filter is not in use.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter |
|---|
IoFilter.NextFilter |
| Constructor Summary | |
|---|---|
ReferenceCountingFilter(IoFilter filter)
|
|
| Method Summary | |
|---|---|
void |
destroy()
Invoked by ReferenceCountingFilter when this filter
is not used by any IoFilterChain anymore, so you can destroy
shared resources. |
void |
exceptionCaught(IoFilter.NextFilter nextFilter,
IoSession session,
Throwable cause)
Filters IoHandler.exceptionCaught(IoSession,Throwable)
event. |
void |
filterClose(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoSession.close() method invocation. |
void |
filterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
Filters IoSession.write(Object) method invocation. |
void |
init()
Invoked by ReferenceCountingFilter when this filter
is added to a IoFilterChain at the first time, so you can
initialize shared resources. |
void |
messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
Filters IoHandler.messageReceived(IoSession,Object)
event. |
void |
messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
Filters IoHandler.messageSent(IoSession,Object)
event. |
void |
onPostAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked after this filter is added to the specified parent. |
void |
onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked after this filter is removed from the specified parent. |
void |
onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked before this filter is added to the specified parent. |
void |
onPreRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
Invoked before this filter is removed from the specified parent. |
void |
sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoHandler.sessionClosed(IoSession) event. |
void |
sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoHandler.sessionCreated(IoSession) event. |
void |
sessionIdle(IoFilter.NextFilter nextFilter,
IoSession session,
IdleStatus status)
Filters IoHandler.sessionIdle(IoSession,IdleStatus)
event. |
void |
sessionOpened(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoHandler.sessionOpened(IoSession) event. |
| Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReferenceCountingFilter(IoFilter filter)
| Method Detail |
|---|
public void init()
throws Exception
IoFilterAdapterReferenceCountingFilter when this filter
is added to a IoFilterChain at the first time, so you can
initialize shared resources. Please note that this method is never
called if you don't wrap a filter with ReferenceCountingFilter.
init in interface IoFilterinit in class IoFilterAdapterException
public void destroy()
throws Exception
IoFilterAdapterReferenceCountingFilter when this filter
is not used by any IoFilterChain anymore, so you can destroy
shared resources. Please note that this method is never called if
you don't wrap a filter with ReferenceCountingFilter.
destroy in interface IoFilterdestroy in class IoFilterAdapterException
public void onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.init() is invoked.
onPreAdd in interface IoFilteronPreAdd in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.destroy() is invoked.
onPostRemove in interface IoFilteronPostRemove in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void exceptionCaught(IoFilter.NextFilter nextFilter,
IoSession session,
Throwable cause)
throws Exception
IoFilterAdapterIoHandler.exceptionCaught(IoSession,Throwable)
event.
exceptionCaught in interface IoFilterexceptionCaught in class IoFilterAdapterException
public void filterClose(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoFilterAdapterIoSession.close() method invocation.
filterClose in interface IoFilterfilterClose in class IoFilterAdapterException
public void filterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
throws Exception
IoFilterAdapterIoSession.write(Object) method invocation.
filterWrite in interface IoFilterfilterWrite in class IoFilterAdapterException
public void messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
throws Exception
IoFilterAdapterIoHandler.messageReceived(IoSession,Object)
event.
messageReceived in interface IoFiltermessageReceived in class IoFilterAdapterException
public void messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
throws Exception
IoFilterAdapterIoHandler.messageSent(IoSession,Object)
event.
messageSent in interface IoFiltermessageSent in class IoFilterAdapterException
public void onPostAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.init() is invoked.
onPostAdd in interface IoFilteronPostAdd in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void onPreRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
IoFilterAdapterIoFilter.destroy() is invoked.
onPreRemove in interface IoFilteronPreRemove in class IoFilterAdapterparent - the parent who called this methodname - the name assigned to this filternextFilter - the IoFilter.NextFilter for this filter. You can reuse
this object until this filter is removed from the chain.
Exception
public void sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoFilterAdapterIoHandler.sessionClosed(IoSession) event.
sessionClosed in interface IoFiltersessionClosed in class IoFilterAdapterException
public void sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoFilterAdapterIoHandler.sessionCreated(IoSession) event.
sessionCreated in interface IoFiltersessionCreated in class IoFilterAdapterException
public void sessionIdle(IoFilter.NextFilter nextFilter,
IoSession session,
IdleStatus status)
throws Exception
IoFilterAdapterIoHandler.sessionIdle(IoSession,IdleStatus)
event.
sessionIdle in interface IoFiltersessionIdle in class IoFilterAdapterException
public void sessionOpened(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoFilterAdapterIoHandler.sessionOpened(IoSession) event.
sessionOpened in interface IoFiltersessionOpened in class IoFilterAdapterException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||