|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smack.debugger.ConsoleDebugger
public class ConsoleDebugger
Very simple debugger that prints to the console (stdout) the sent and received stanzas. Use this debugger with caution since printing to the console is an expensive operation that may even block the thread since only one thread may print at a time.
It is possible to not only print the raw sent and received stanzas but also the interpreted packets by Smack. By default interpreted packets won't be printed. To enable this feature just change the printInterpreted static variable to true.
Field Summary | |
---|---|
static boolean |
printInterpreted
|
Constructor Summary | |
---|---|
ConsoleDebugger(Connection connection,
java.io.Writer writer,
java.io.Reader reader)
|
Method Summary | |
---|---|
java.io.Reader |
getReader()
Returns the special Reader that wraps the main Reader and logs data to the GUI. |
PacketListener |
getReaderListener()
Returns the thread that will listen for all incoming packets and write them to the GUI. |
java.io.Writer |
getWriter()
Returns the special Writer that wraps the main Writer and logs data to the GUI. |
PacketListener |
getWriterListener()
Returns the thread that will listen for all outgoing packets and write them to the GUI. |
java.io.Reader |
newConnectionReader(java.io.Reader newReader)
Returns a new special Reader that wraps the new connection Reader. |
java.io.Writer |
newConnectionWriter(java.io.Writer newWriter)
Returns a new special Writer that wraps the new connection Writer. |
void |
userHasLogged(java.lang.String user)
Called when a user has logged in to the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean printInterpreted
Constructor Detail |
---|
public ConsoleDebugger(Connection connection, java.io.Writer writer, java.io.Reader reader)
Method Detail |
---|
public java.io.Reader newConnectionReader(java.io.Reader newReader)
SmackDebugger
newConnectionReader
in interface SmackDebugger
public java.io.Writer newConnectionWriter(java.io.Writer newWriter)
SmackDebugger
newConnectionWriter
in interface SmackDebugger
public void userHasLogged(java.lang.String user)
SmackDebugger
userHasLogged
in interface SmackDebugger
user
- the user@host/resource that has just logged inpublic java.io.Reader getReader()
SmackDebugger
getReader
in interface SmackDebugger
public java.io.Writer getWriter()
SmackDebugger
getWriter
in interface SmackDebugger
public PacketListener getReaderListener()
SmackDebugger
getReaderListener
in interface SmackDebugger
public PacketListener getWriterListener()
SmackDebugger
getWriterListener
in interface SmackDebugger
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |