org.apache.qpid.client.protocol
Class ProtocolBufferMonitorFilter
java.lang.Object
org.apache.mina.common.IoFilterAdapter
org.apache.qpid.client.protocol.ProtocolBufferMonitorFilter
- All Implemented Interfaces:
- org.apache.mina.common.IoFilter
public class ProtocolBufferMonitorFilter
- extends org.apache.mina.common.IoFilterAdapter
A MINA filter that monitors the numbers of messages pending to be sent by MINA. It outputs a message
when a threshold has been exceeded, and has a frequency configuration so that messages are not output
too often.
Nested classes/interfaces inherited from interface org.apache.mina.common.IoFilter |
org.apache.mina.common.IoFilter.NextFilter, org.apache.mina.common.IoFilter.WriteRequest |
Methods inherited from class org.apache.mina.common.IoFilterAdapter |
destroy, exceptionCaught, filterClose, filterWrite, init, onPostAdd, onPostRemove, onPreAdd, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_FREQUENCY
public static long DEFAULT_FREQUENCY
DEFAULT_THRESHOLD
public static int DEFAULT_THRESHOLD
ProtocolBufferMonitorFilter
public ProtocolBufferMonitorFilter()
ProtocolBufferMonitorFilter
public ProtocolBufferMonitorFilter(int threshold,
long frequency)
messageReceived
public void messageReceived(org.apache.mina.common.IoFilter.NextFilter nextFilter,
org.apache.mina.common.IoSession session,
java.lang.Object message)
throws java.lang.Exception
- Specified by:
messageReceived
in interface org.apache.mina.common.IoFilter
- Overrides:
messageReceived
in class org.apache.mina.common.IoFilterAdapter
- Throws:
java.lang.Exception
messageSent
public void messageSent(org.apache.mina.common.IoFilter.NextFilter nextFilter,
org.apache.mina.common.IoSession session,
java.lang.Object message)
throws java.lang.Exception
- Specified by:
messageSent
in interface org.apache.mina.common.IoFilter
- Overrides:
messageSent
in class org.apache.mina.common.IoFilterAdapter
- Throws:
java.lang.Exception
getBufferedMessages
public int getBufferedMessages()
getThreshold
public int getThreshold()
setThreshold
public void setThreshold(int threshold)
getOutputFrequencyInMillis
public long getOutputFrequencyInMillis()
setOutputFrequencyInMillis
public void setOutputFrequencyInMillis(long outputFrequencyInMillis)
getLastMessageOutputTime
public long getLastMessageOutputTime()