/** * Create new SLF4J Smack Debugger instance * @param connection Smack connection to debug * @param writer connection data writer to observe * @param reader connection data reader to observe */ public SLF4JSmackDebugger(XMPPConnection connection, Writer writer, Reader reader) { this.connection = connection; this.writer = new ObservableWriter(writer); this.writer.addWriterListener(slf4JRawXmlListener); this.reader = new ObservableReader(Validate.notNull(reader)); this.reader.addReaderListener(slf4JRawXmlListener); this.connection.addConnectionListener(new SLF4JLoggingConnectionListener(connection, logger)); }
public Writer newConnectionWriter(Writer newWriter) { writer.removeWriterListener(writerListener); ObservableWriter debugWriter = new ObservableWriter(newWriter); debugWriter.addWriterListener(writerListener); writer = debugWriter; return writer; }
public Writer newConnectionWriter(Writer newWriter) { ((ObservableWriter) writer).removeWriterListener(writerListener); ObservableWriter debugWriter = new ObservableWriter(newWriter); debugWriter.addWriterListener(writerListener); writer = debugWriter; return writer; }
/** * Stops debugging the connection. Removes any listener on the connection. */ void cancel() { connection.removeConnectionListener(connListener); connection.removeAsyncStanzaListener(packetReaderListener); connection.removePacketSendingListener(packetWriterListener); ((ObservableReader) reader).removeReaderListener(readerListener); ((ObservableWriter) writer).removeWriterListener(writerListener); messagesTable = null; }
public Writer newConnectionWriter(Writer newWriter) { ((ObservableWriter)writer).removeWriterListener(writerListener); ObservableWriter debugWriter = new ObservableWriter(newWriter); debugWriter.addWriterListener(writerListener); writer = debugWriter; return writer; }
/** * Notification that the root window is closing. Stop listening for received and * transmitted packets. * * @param evt the event that indicates that the root window is closing */ public void rootWindowClosing(WindowEvent evt) { connection.removeAsyncStanzaListener(listener); ((ObservableReader)reader).removeReaderListener(readerListener); ((ObservableWriter)writer).removeWriterListener(writerListener); }
/** * Notification that the root window is closing. Stop listening for received * and transmitted packets. * * @param evt * the event that indicates that the root window is closing */ public void rootWindowClosing(WindowEvent evt) { connection.removePacketListener(listener); ((ObservableReader) reader).removeReaderListener(readerListener); ((ObservableWriter) writer).removeWriterListener(writerListener); }