class XmppAppender extends AppenderBase<E> {

    @Override
    public void stop() {
        boolean doStop = isStarted();
        super.stop();
        if (doStop && conn != null && conn.isConnected()) {
            conn.disconnect();
            chat = null;
        }
    }

}