au.com.terabit.jproactor
Interface AsynchChannelHandler

All Known Implementing Classes:
Acceptor, SSLAsynchChannel

public interface AsynchChannelHandler

The AsynchHandler provides gateway into JavaProactor. Any class that would like to take advantage of JavaProactor needs to implemet this interface.

The implementing classes usually will need to define protocol as a some kind m_state machine. That m_state machine will interact with Demultiplexor by implementing AsynchHandler interface.

Copyright © 2003 Terabit Pty Ltd. All rights reserved.

Version:
$Revision$ $Date$
Author:
Yevgeny Libman
See Also:
au.com.terabit.multiplexor.EchoServerProtocol

Method Summary
 void channelAttached(AsynchChannel channel)
          Notifies that this handler is associated with the TCPAsynchChannel instance.
 void channelClosed(AsynchChannel channel)
          Notifies that cnannel is closed.
 

Method Detail

channelAttached

void channelAttached(AsynchChannel channel)
                     throws java.lang.Exception
Notifies that this handler is associated with the TCPAsynchChannel instance.

One AsynchHandler can be shared with multiple socket channels, e.g. chat server. This mehtod is called by TCPAsynchChannel.

Parameters:
channel - a new channel that is associated with this protocol.
Throws:
java.lang.Exception

channelClosed

void channelClosed(AsynchChannel channel)
                   throws java.lang.Exception
Notifies that cnannel is closed.

Parameters:
channel - asynchronous channel that was closed
Throws:
java.lang.Exception