Package org.apache.mina.filter
Class ReferenceCountingIoFilter
- java.lang.Object
-
- org.apache.mina.filter.ReferenceCountingIoFilter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.mina.common.IoFilter
IoFilter.NextFilter, IoFilter.WriteRequest
-
-
Constructor Summary
Constructors Constructor Description ReferenceCountingIoFilter(IoFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Invoked byReferenceCountingIoFilter
when this filter is not used by anyIoFilterChain
anymore, so you can destroy shared resources.void
exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Throwable cause)
FiltersIoHandler.exceptionCaught(IoSession,Throwable)
event.void
filterClose(IoFilter.NextFilter nextFilter, IoSession session)
FiltersIoSession.close()
method invocation.void
filterWrite(IoFilter.NextFilter nextFilter, IoSession session, IoFilter.WriteRequest writeRequest)
FiltersIoSession.write(Object)
method invocation.void
init()
Invoked byReferenceCountingIoFilter
when this filter is added to aIoFilterChain
at the first time, so you can initialize shared resources.void
messageReceived(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Object message)
FiltersIoHandler.messageReceived(IoSession,Object)
event.void
messageSent(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Object message)
FiltersIoHandler.messageSent(IoSession,Object)
event.void
onPostAdd(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter)
Invoked after this filter is added to the specified parent.void
onPostRemove(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter)
Invoked after this filter is removed from the specified parent.void
onPreAdd(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter)
Invoked before this filter is added to the specified parent.void
onPreRemove(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter)
Invoked before this filter is removed from the specified parent.void
sessionClosed(IoFilter.NextFilter nextFilter, IoSession session)
FiltersIoHandler.sessionClosed(IoSession)
event.void
sessionCreated(IoFilter.NextFilter nextFilter, IoSession session)
FiltersIoHandler.sessionCreated(IoSession)
event.void
sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status)
FiltersIoHandler.sessionIdle(IoSession,IdleStatus)
event.void
sessionOpened(IoFilter.NextFilter nextFilter, IoSession session)
FiltersIoHandler.sessionOpened(IoSession)
event.
-
-
-
Constructor Detail
-
ReferenceCountingIoFilter
public ReferenceCountingIoFilter(IoFilter filter)
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
Description copied from interface:IoFilter
Invoked byReferenceCountingIoFilter
when this filter is added to aIoFilterChain
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 withReferenceCountingIoFilter
.
-
destroy
public void destroy() throws java.lang.Exception
Description copied from interface:IoFilter
Invoked byReferenceCountingIoFilter
when this filter is not used by anyIoFilterChain
anymore, so you can destroy shared resources. Please note that this method is never called if you don't wrap a filter withReferenceCountingIoFilter
.
-
onPreAdd
public void onPreAdd(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter) throws java.lang.Exception
Description copied from interface:IoFilter
Invoked before this filter is added to the specified parent. Please note that this method can be invoked more than once if this filter is added to more than one parents. This method is not invoked beforeIoFilter.init()
is invoked.- Specified by:
onPreAdd
in interfaceIoFilter
- Parameters:
parent
- the parent who called this methodname
- the name assigned to this filternextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.- Throws:
java.lang.Exception
-
onPostRemove
public void onPostRemove(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter) throws java.lang.Exception
Description copied from interface:IoFilter
Invoked after this filter is removed from the specified parent. Please note that this method can be invoked more than once if this filter is removed from more than one parents. This method is always invoked beforeIoFilter.destroy()
is invoked.- Specified by:
onPostRemove
in interfaceIoFilter
- Parameters:
parent
- the parent who called this methodname
- the name assigned to this filternextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Throwable cause) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.exceptionCaught(IoSession,Throwable)
event.- Specified by:
exceptionCaught
in interfaceIoFilter
- Throws:
java.lang.Exception
-
filterClose
public void filterClose(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoSession.close()
method invocation.- Specified by:
filterClose
in interfaceIoFilter
- Throws:
java.lang.Exception
-
filterWrite
public void filterWrite(IoFilter.NextFilter nextFilter, IoSession session, IoFilter.WriteRequest writeRequest) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoSession.write(Object)
method invocation.- Specified by:
filterWrite
in interfaceIoFilter
- Throws:
java.lang.Exception
-
messageReceived
public void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Object message) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.messageReceived(IoSession,Object)
event.- Specified by:
messageReceived
in interfaceIoFilter
- Throws:
java.lang.Exception
-
messageSent
public void messageSent(IoFilter.NextFilter nextFilter, IoSession session, java.lang.Object message) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.messageSent(IoSession,Object)
event.- Specified by:
messageSent
in interfaceIoFilter
- Throws:
java.lang.Exception
-
onPostAdd
public void onPostAdd(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter) throws java.lang.Exception
Description copied from interface:IoFilter
Invoked after this filter is added to the specified parent. Please note that this method can be invoked more than once if this filter is added to more than one parents. This method is not invoked beforeIoFilter.init()
is invoked.- Specified by:
onPostAdd
in interfaceIoFilter
- Parameters:
parent
- the parent who called this methodname
- the name assigned to this filternextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.- Throws:
java.lang.Exception
-
onPreRemove
public void onPreRemove(IoFilterChain parent, java.lang.String name, IoFilter.NextFilter nextFilter) throws java.lang.Exception
Description copied from interface:IoFilter
Invoked before this filter is removed from the specified parent. Please note that this method can be invoked more than once if this filter is removed from more than one parents. This method is always invoked beforeIoFilter.destroy()
is invoked.- Specified by:
onPreRemove
in interfaceIoFilter
- Parameters:
parent
- the parent who called this methodname
- the name assigned to this filternextFilter
- theIoFilter.NextFilter
for this filter. You can reuse this object until this filter is removed from the chain.- Throws:
java.lang.Exception
-
sessionClosed
public void sessionClosed(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.sessionClosed(IoSession)
event.- Specified by:
sessionClosed
in interfaceIoFilter
- Throws:
java.lang.Exception
-
sessionCreated
public void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.sessionCreated(IoSession)
event.- Specified by:
sessionCreated
in interfaceIoFilter
- Throws:
java.lang.Exception
-
sessionIdle
public void sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.sessionIdle(IoSession,IdleStatus)
event.- Specified by:
sessionIdle
in interfaceIoFilter
- Throws:
java.lang.Exception
-
sessionOpened
public void sessionOpened(IoFilter.NextFilter nextFilter, IoSession session) throws java.lang.Exception
Description copied from interface:IoFilter
FiltersIoHandler.sessionOpened(IoSession)
event.- Specified by:
sessionOpened
in interfaceIoFilter
- Throws:
java.lang.Exception
-
-