1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Remove connection field from BOSHConnectionListener

This commit is contained in:
Florian Schmaus 2014-12-28 17:46:47 +01:00
parent f4aaf387d4
commit d295939285

View file

@ -161,7 +161,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
} }
client = BOSHClient.create(cfgBuilder.build()); client = BOSHClient.create(cfgBuilder.build());
client.addBOSHClientConnListener(new BOSHConnectionListener(this)); client.addBOSHClientConnListener(new BOSHConnectionListener());
client.addBOSHClientResponseListener(new BOSHPacketReader()); client.addBOSHClientResponseListener(new BOSHPacketReader());
// Initialize the debugger // Initialize the debugger
@ -459,12 +459,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
*/ */
private class BOSHConnectionListener implements BOSHClientConnListener { private class BOSHConnectionListener implements BOSHClientConnListener {
private final XMPPBOSHConnection connection;
public BOSHConnectionListener(XMPPBOSHConnection connection) {
this.connection = connection;
}
/** /**
* Notify the BOSHConnection about connection state changes. * Notify the BOSHConnection about connection state changes.
* Process the connection listeners and try to login if the * Process the connection listeners and try to login if the
@ -477,13 +471,13 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
if (isFirstInitialization) { if (isFirstInitialization) {
isFirstInitialization = false; isFirstInitialization = false;
for (ConnectionCreationListener listener : getConnectionCreationListeners()) { for (ConnectionCreationListener listener : getConnectionCreationListeners()) {
listener.connectionCreated(connection); listener.connectionCreated(XMPPBOSHConnection.this);
} }
} }
else { else {
try { try {
if (wasAuthenticated) { if (wasAuthenticated) {
connection.login(); login();
} }
for (ConnectionListener listener : getConnectionListeners()) { for (ConnectionListener listener : getConnectionListeners()) {
listener.reconnectionSuccessful(); listener.reconnectionSuccessful();
@ -513,8 +507,8 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
} }
} }
finally { finally {
synchronized (connection) { synchronized (XMPPBOSHConnection.this) {
connection.notifyAll(); XMPPBOSHConnection.this.notifyAll();
} }
} }
} }