mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Move notifyReconnection in AbstractXMPPConnection
This commit is contained in:
parent
82eb9b18dd
commit
67c0a7089b
4 changed files with 19 additions and 24 deletions
|
@ -1073,6 +1073,23 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a notification indicating that the connection was reconnected successfully.
|
||||
*/
|
||||
protected void notifyReconnection() {
|
||||
// Notify connection listeners of the reconnection.
|
||||
for (ConnectionListener listener : getConnectionListeners()) {
|
||||
try {
|
||||
listener.reconnectionSuccessful();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// Catch and print any exception so we can recover
|
||||
// from a faulty listener
|
||||
LOGGER.log(Level.WARNING, "notifyReconnection()", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A wrapper class to associate a packet filter with a listener.
|
||||
*/
|
||||
|
|
|
@ -81,9 +81,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
connectionID = "dummy-" + new Random(new Date().getTime()).nextInt();
|
||||
|
||||
if (reconnect) {
|
||||
for (ConnectionListener listener : getConnectionListeners()) {
|
||||
listener.reconnectionSuccessful();
|
||||
}
|
||||
notifyReconnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue