com.sun.grizzly.util
Interface ConnectionCloseHandler

All Known Implementing Classes:
WebSocketCloseHandler

public interface ConnectionCloseHandler

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.
 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 © 2012 Oracle Corporation. All Rights Reserved.