Closed GoogleCodeExporter closed 9 years ago
Implementation in Channel.java:
/**
* Add a {@link ConnectionMonitor} to this connection. Can be invoked at any time,
* but it is best to add connection monitors before invoking
* <code>connect()</code> to avoid glitches (e.g., you add a connection monitor after
* a successful connect(), but the connection has died in the mean time. Then,
* your connection monitor won't be notified.)
* <p>
* You can add as many monitors as you like.
*
* @see ConnectionMonitor
* @see #removeConnectionMonitor
*
* @param cmon An object implementing the <code>ConnectionMonitor</code> interface.
*/
public synchronized void addConnectionMonitor(ConnectionMonitor cmon)
{
if (cmon == null)
throw new NullPointerException("cmon argument is null");
if (connectionMonitors.contains(cmon))
throw new IllegalArgumentException("monitor already exists");
connectionMonitors.addElement(cmon);
if (tm != null)
tm.setConnectionMonitors(connectionMonitors);
}
/**
* Remove a {@link ConnectionMonitor} from this connection.
*
* @see ConnectionMonitor
* @see #addConnectionMonitor
*
* @param cmon An object implementing the <code>ConnectionMonitor</code> interface.
*/
public synchronized void removeConnectionMonitor(ConnectionMonitor cmon)
{
if (!connectionMonitors.removeElement(cmon))
throw new IllegalArgumentException("no such monitor");
if (tm != null)
tm.setConnectionMonitors(connectionMonitors);
}
Original comment by EsmondP...@gmail.com
on 21 Jun 2012 at 4:04
Fixed in SVN
Original comment by cleondris
on 1 Aug 2013 at 12:50
Original issue reported on code.google.com by
EsmondP...@gmail.com
on 20 Jun 2012 at 1:38