0
|
1
|
|
2 package com.trilead.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@trilead.com
|
|
9 * @version $Id: ConnectionMonitor.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
|
|
10 */
|
|
11
|
|
12 public interface ConnectionMonitor {
|
|
13 /**
|
|
14 * This method is called after the connection's underlying
|
|
15 * socket has been closed. E.g., due to the {@link Connection#close()} request of the
|
|
16 * user, if the peer closed the connection, due to a fatal error during connect()
|
|
17 * (also if the socket cannot be established) or if a fatal error occured on
|
|
18 * an established connection.
|
|
19 * <p>
|
|
20 * This is an experimental feature.
|
|
21 * <p>
|
|
22 * You MUST NOT make any assumption about the thread that invokes this method.
|
|
23 * <p>
|
|
24 * <b>Please note: if the connection is not connected (e.g., there was no successful
|
|
25 * connect() call), then the invocation of {@link Connection#close()} will NOT trigger
|
|
26 * this method.</b>
|
|
27 *
|
|
28 * @see Connection#addConnectionMonitor(ConnectionMonitor)
|
|
29 *
|
|
30 * @param reason Includes an indication why the socket was closed.
|
|
31 */
|
|
32 public void connectionLost(Throwable reason);
|
|
33 } |