org.activeio.filter
Class PacketAggregatingSyncChannel

java.lang.Object
  extended byorg.activeio.FilterSyncChannel
      extended byorg.activeio.filter.PacketAggregatingSyncChannel
All Implemented Interfaces:
Channel, Disposable, InputSyncChannel, OutputChannel, Service, SyncChannel

public final class PacketAggregatingSyncChannel
extends FilterSyncChannel

This PacketAggregatingSynchChannel 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 org.activeio.SynchChannel adds a 4 byte header to each packet that is sent down.

Version:
$Revision$

Field Summary
 
Fields inherited from interface org.activeio.Service
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT
 
Constructor Summary
PacketAggregatingSyncChannel(SyncChannel next)
           
 
Method Summary
 Packet read(long timeout)
          Used to synchronously receive a packet of information going 'up' the channel.
 void write(Packet packet)
          Sends a packet down the channel towards the media.
 
Methods inherited from class org.activeio.FilterSyncChannel
dispose, flush, getNext, narrow, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PacketAggregatingSyncChannel

public PacketAggregatingSyncChannel(SyncChannel next)
Parameters:
next -
Method Detail

read

public Packet read(long timeout)
            throws IOException
Description copied from interface: InputSyncChannel
Used to synchronously receive a packet of information going 'up' the channel. This method blocks until a packet is received or the operation experiences timeout.

Specified by:
read in interface InputSyncChannel
Overrides:
read in class FilterSyncChannel
Throws:
IOException
See Also:
InputSyncChannel.read(long)

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 FilterSyncChannel
Throws:
IOException
See Also:
org.activeio.Channel#write(org.activeio.Packet)


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