mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Call connection created listeners in constructor
Fixes SMACK-638.
This commit is contained in:
parent
5188c6f934
commit
f410ece468
3 changed files with 4 additions and 21 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue