org.jboss.xnio
Interface IoHandler<T extends java.nio.channels.Channel>

Type Parameters:
T - the type of channel that the handler can handle
All Superinterfaces:
IoReadHandler<T>, IoWriteHandler<T>
All Known Implementing Classes:
DelegatingIoHandler

public interface IoHandler<T extends java.nio.channels.Channel>
extends IoReadHandler<T>, IoWriteHandler<T>

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.
 
Methods inherited from interface org.jboss.xnio.IoReadHandler
handleReadable
 
Methods inherited from interface org.jboss.xnio.IoWriteHandler
handleWritable
 

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

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