org.activeio.filter
Class PacketAggregatingAsynchChannel

java.lang.Object
  extended byorg.activeio.FilterAsynchChannel
      extended byorg.activeio.filter.PacketAggregatingAsynchChannel
All Implemented Interfaces:
AsynchChannel, AsynchChannelListener, Channel, Disposable, InputAsynchChannel, OutputChannel, Service

public final class PacketAggregatingAsynchChannel
extends FilterAsynchChannel

This PacketAggregatingAsynchChannel can be used when the client is sending a 'record' style packet down the channel stack and needs receiving end to receive the same 'record' packets. This is very usefull since in general, a channel does not garantee that a Packet that is sent down will not be fragmented or combined with other Packet objects. This AsynchChannel adds a 4 byte header to each packet that is sent down.

Version:
$Revision$

Field Summary
 
Fields inherited from class org.activeio.FilterAsynchChannel
channelListener, next
 
Fields inherited from interface org.activeio.Service
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT
 
Constructor Summary
PacketAggregatingAsynchChannel(AsynchChannel next)
           
 
Method Summary
 void onPacket(Packet packet)
          A AsynchChannel 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.FilterAsynchChannel
dispose, flush, getAsynchChannelListener, getNext, narrow, onPacketError, setAsynchChannelListener, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PacketAggregatingAsynchChannel

public PacketAggregatingAsynchChannel(AsynchChannel next)
Method Detail

onPacket

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

Specified by:
onPacket in interface AsynchChannelListener
Overrides:
onPacket in class FilterAsynchChannel
See Also:
org.activeio.AsynchChannelListener#onPacket(org.activeio.channel.Packet)

write

public void write(Packet packet)
           throws java.io.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 FilterAsynchChannel
Throws:
java.io.IOException
See Also:
org.activeio.Channel#write(org.activeio.channel.Packet)


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