KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > ssh2 > ConnectionMonitor


1
2 package ch.ethz.ssh2;
3
4 /**
5  * A <code>ConnectionMonitor</code> is used to get notified when the
6  * underlying socket of a connection is closed.
7  *
8  * @author Christian Plattner, plattner@inf.ethz.ch
9  * @version $Id: ConnectionMonitor.java,v 1.3 2006/08/11 17:44:37 cplattne Exp $
10  */

11
12 public interface ConnectionMonitor
13 {
14     /**
15      * This method is called after the connection's underlying
16      * socket has been closed. E.g., due to the {@link Connection#close()} request of the
17      * user, if the peer closed the connection, due to a fatal error during connect()
18      * (also if the socket cannot be established) or if a fatal error occured on
19      * an established connection.
20      * <p>
21      * This is an experimental feature.
22      * <p>
23      * You MUST NOT make any assumption about the thread that invokes this method.
24      * <p>
25      * <b>Please note: if the connection is not connected (e.g., there was no successful
26      * connect() call), then the invocation of {@link Connection#close()} will NOT trigger
27      * this method.</b>
28      *
29      * @see Connection#addConnectionMonitor(ConnectionMonitor)
30      *
31      * @param reason Includes an indication why the socket was closed.
32      */

33     public void connectionLost(Throwable JavaDoc reason);
34 }
Popular Tags