@Override
public void addConnectionListener(final IMConnectionListener listener) {
lock();
try {
ConnectionListener l = new AbstractConnectionListener() {
@Override
public void connectionClosedOnError(Exception e) {
listener.connectionBroken(e);
}
};