XNIO version 1.1.0.GA

org.jboss.xnio
Interface IoHandler<T extends Channel>

Type Parameters:
T - the type of channel that the handler can handle

public interface IoHandler<T extends Channel>

A channel I/O handler. Implementations of this interface handle traffic over a Channel.


Method Summary
 void handleClosed(T channel)
          Handle channel close.
 void handleOpened(T channel)
          Handle channel open.
 void handleReadable(T channel)
          Handle channel readability.
 void handleWritable(T channel)
          Handle channel writability.
 

Method Detail

handleOpened

void handleOpened(T channel)
Handle channel open. This method is called exactly once per channel. When a channel is opened, both reads and writes are suspended initially, and must be resumed manually. If this method fails by throwing an exception, the channel open is aborted and the underlying channel is terminated without invoking the handleClosed(java.nio.channels.Channel) method.

Parameters:
channel - the channel that was opened

handleReadable

void handleReadable(T channel)
Handle channel readability. Called when the channel may be read from. Further read notifications from the channel are automatically suspended.

Parameters:
channel - the channel that is readable

handleWritable

void handleWritable(T channel)
Handle channel writability. Called when the channel may be read from. Further read notifications from the channel are automatically suspended.

Parameters:
channel - the channel that is readable

handleClosed

void handleClosed(T channel)
Handle channel close. This method is called exactly once when the channel is closed. If the channel's Channel.close() method is called again, this method is not invoked.

Parameters:
channel - the channel that was closed

XNIO version 1.1.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.