mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 03:52:06 +01:00
Remove connection field from BOSHConnectionListener
This commit is contained in:
parent
f4aaf387d4
commit
d295939285
1 changed files with 5 additions and 11 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue