01: package ch.ethz.ssh2;
02:
03: /**
04: * A <code>ConnectionMonitor</code> is used to get notified when the
05: * underlying socket of a connection is closed.
06: *
07: * @author Christian Plattner, plattner@inf.ethz.ch
08: * @version $Id: ConnectionMonitor.java,v 1.3 2006/08/11 17:44:37 cplattne Exp $
09: */
10:
11: public interface ConnectionMonitor {
12: /**
13: * This method is called after the connection's underlying
14: * socket has been closed. E.g., due to the {@link Connection#close()} request of the
15: * user, if the peer closed the connection, due to a fatal error during connect()
16: * (also if the socket cannot be established) or if a fatal error occured on
17: * an established connection.
18: * <p>
19: * This is an experimental feature.
20: * <p>
21: * You MUST NOT make any assumption about the thread that invokes this method.
22: * <p>
23: * <b>Please note: if the connection is not connected (e.g., there was no successful
24: * connect() call), then the invocation of {@link Connection#close()} will NOT trigger
25: * this method.</b>
26: *
27: * @see Connection#addConnectionMonitor(ConnectionMonitor)
28: *
29: * @param reason Includes an indication why the socket was closed.
30: */
31: public void connectionLost(Throwable reason);
32: }
|