public synchronized BOSHClientConnEvent waitForDisconnection() throws InterruptedException {
            while(disconnectReceived.get() == null) {
                wait();
            }
            return disconnectReceived.getAndSet(null);
        }