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 final long DEFAULT_FREQUENCY
- See Also:
- Constant Field Values
DEFAULT_THRESHOLD
public static final int DEFAULT_THRESHOLD
- See Also:
- Constant Field Values
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,
Object message)
throws Exception
- Specified by:
messageReceived
in interface org.apache.mina.common.IoFilter
- Overrides:
messageReceived
in class org.apache.mina.common.IoFilterAdapter
- Throws:
Exception
messageSent
public void messageSent(org.apache.mina.common.IoFilter.NextFilter nextFilter,
org.apache.mina.common.IoSession session,
Object message)
throws Exception
- Specified by:
messageSent
in interface org.apache.mina.common.IoFilter
- Overrides:
messageSent
in class org.apache.mina.common.IoFilterAdapter
- Throws:
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()
Licensed to the Apache Software Foundation