org.activeio.filter
Class AsyncWriteAsyncChannel

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

public class AsyncWriteAsyncChannel
extends FilterAsyncChannel


Nested Class Summary
static class AsyncWriteAsyncChannel.ObjectDispatcher
           
static class AsyncWriteAsyncChannel.ObjectDispatcherX
           
 
Field Summary
 
Fields inherited from class org.activeio.FilterAsyncChannel
channelListener, next
 
Fields inherited from interface org.activeio.Service
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT
 
Fields inherited from interface org.activeio.Service
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT
 
Constructor Summary
AsyncWriteAsyncChannel(AsyncChannel next)
           
AsyncWriteAsyncChannel(AsyncChannel next, int queueSize)
           
 
Method Summary
 void flush()
          Some channels may buffer data which may be sent down if flush() is called.
 void onObject(Object o)
           
 void stop(long timeout)
          Stops the channel.
 void write(Packet packet)
          Sends a packet down the channel towards the media.
 
Methods inherited from class org.activeio.FilterAsyncChannel
dispose, getAsyncChannelListener, getNext, narrow, onPacket, onPacketError, setAsyncChannelListener, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsyncWriteAsyncChannel

public AsyncWriteAsyncChannel(AsyncChannel next)

AsyncWriteAsyncChannel

public AsyncWriteAsyncChannel(AsyncChannel next,
                              int queueSize)
Method Detail

onObject

public void onObject(Object o)

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

flush

public void flush()
           throws IOException
Description copied from interface: OutputChannel
Some channels may buffer data which may be sent down if flush() is called.

Specified by:
flush in interface OutputChannel
Overrides:
flush in class FilterAsyncChannel
Throws:
IOException

stop

public void stop(long timeout)
          throws IOException
Description copied from interface: Service
Stops the channel. Once stopped, the channel is in the stopped state.

Specified by:
stop in interface Service
Overrides:
stop in class FilterAsyncChannel
Parameters:
timeout - The amount of time the channel is allowed to take to gracefully stop. If the timeout is exceeded, the channel should do a forcefull stop.
Throws:
IOException
See Also:
Service.stop(long)


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