com.sun.grizzly.util
Interface ConnectionCloseHandler

All Superinterfaces:
Handler

public interface ConnectionCloseHandler
extends Handler

Simple listener to be used when an application needs to be notified when a a SelectorHandler, ConnectionHandler or SelectionKeyHandler close a connection (locallyClosed(java.nio.channels.SelectionKey)), or when a remote client close the connection (remotlyClosed(java.nio.channels.SelectionKey)). Note that when the connection is closed remotly, the (remotlyClosed(java.nio.channels.SelectionKey)) will be invoked immediately followed by a (locallyClosed(java.nio.channels.SelectionKey)), as Grizzly will discard the server side dirty SelectionKey.

Author:
Jeanfrancois Arcand

Method Summary
 void locallyClosed(SelectionKey key)
          Invoked when the a SelectionKey is cancelled locally, e.g. by one SelectorHandler, ConnectionHandler or SelectionKeyHandler
 void remotlyClosed(SelectionKey key)
          Invoked when a remote connection is being closed.
 

Method Detail

locallyClosed

void locallyClosed(SelectionKey key)
Invoked when the a SelectionKey is cancelled locally, e.g. by one SelectorHandler, ConnectionHandler or SelectionKeyHandler

Parameters:
key - a SelectionKey

remotlyClosed

void remotlyClosed(SelectionKey key)
Invoked when a remote connection is being closed.

Parameters:
key - a SelectionKey


Copyright © 2008 SUN Microsystems. All Rights Reserved.