org.activeio.filter
Class CounterAsyncChannel

java.lang.Object
  extended byorg.activeio.FilterAsyncChannel
      extended byorg.activeio.filter.CounterAsyncChannel
All Implemented Interfaces:
AsyncChannel, AsyncChannelListener, Channel, Disposable, InputAsyncChannel, OutputChannel, Service

public final class CounterAsyncChannel
extends FilterAsyncChannel

A CounterAsyncChannel is a simple org.activeio.AsyncChannelFilter that counts the number bytes that been sent down and up through the channel. The org.activeio.counter.CounterAttribueEnum.COUNTER_INBOUND_COUNT and org.activeio.counter.CounterAttribueEnum.COUNTER_OUTBOUND_COUNT attributes can be used to find query the channel to get the current inbound and outbound byte counts.

Version:
$Revision$

Field Summary
 
Fields inherited from class org.activeio.FilterAsyncChannel
channelListener, next
 
Fields inherited from interface org.activeio.Service
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT
 
Constructor Summary
CounterAsyncChannel(AsyncChannel next)
           
 
Method Summary
 long getInBoundCounter()
           
 long getOutBoundCounter()
           
 void onPacket(Packet packet)
          A AsyncChannel will call this method to deliver an 'up' packet to a consumer.
 void write(Packet packet)
          Sends a packet down the channel towards the media.
 
Methods inherited from class org.activeio.FilterAsyncChannel
dispose, flush, getAsyncChannelListener, getNext, narrow, onPacketError, setAsyncChannelListener, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterAsyncChannel

public CounterAsyncChannel(AsyncChannel next)
Parameters:
next -
Method Detail

onPacket

public void onPacket(Packet packet)
Description copied from interface: AsyncChannelListener
A AsyncChannel will call this method to deliver an 'up' packet to a consumer.

Specified by:
onPacket in interface AsyncChannelListener
Overrides:
onPacket in class FilterAsyncChannel
See Also:
FilterAsyncChannel.onPacket(org.activeio.Packet)

write

public void write(Packet packet)
           throws IOException
Description copied from interface: OutputChannel
Sends a packet down the channel towards the media.

Specified by:
write in interface OutputChannel
Overrides:
write in class FilterAsyncChannel
Throws:
IOException
See Also:
FilterAsyncChannel.write(org.activeio.Packet)

getInBoundCounter

public long getInBoundCounter()

getOutBoundCounter

public long getOutBoundCounter()


Copyright © -2007 The ActiveIO Project. All Rights Reserved.