1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

Call connection created listeners in constructor

Fixes SMACK-638.
This commit is contained in:
Florian Schmaus 2015-03-17 12:06:55 +01:00
parent 5188c6f934
commit f410ece468
3 changed files with 4 additions and 21 deletions

View file

@ -102,15 +102,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
SmackConfiguration.getVersion();
}
/**
* Get the collection of listeners that are interested in connection creation events.
*
* @return a collection of listeners interested on new connections.
*/
protected static Collection<ConnectionCreationListener> getConnectionCreationListeners() {
return XMPPConnectionRegistry.getConnectionCreationListeners();
}
/**
* A collection of ConnectionListeners which listen for connection closing
* and reconnection events.
@ -302,6 +293,10 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
*/
protected AbstractXMPPConnection(ConnectionConfiguration configuration) {
config = configuration;
// Notify listeners that a new connection has been established
for (ConnectionCreationListener listener : XMPPConnectionRegistry.getConnectionCreationListeners()) {
listener.connectionCreated(this);
}
}
protected ConnectionConfiguration getConfiguration() {