edu.rice.cs.plt.debug
Class LogSink.Message

java.lang.Object
  extended by edu.rice.cs.plt.debug.LogSink.Message
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LogSink.ErrorMessage, LogSink.StackMessage, LogSink.ValueMessage
Enclosing interface:
LogSink

public abstract static class LogSink.Message
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
protected LogSink.Message(LogSink.Message copy)
           
protected LogSink.Message(ThreadSnapshot thread)
           
protected LogSink.Message(ThreadSnapshot thread, java.lang.String text)
           
 
Method Summary
abstract
<T> T
apply(LogSink.MessageVisitor<? extends T> visitor)
           
 Option<java.lang.StackTraceElement> caller()
          The location from which the log method was invoked, if available.
abstract  void send(LogSink sink)
           
abstract  LogSink.Message serializable()
          Convert the message to a form that is guaranteed to be serializable (e.g., invokes toString() on objects of arbitrary type).
 java.lang.Iterable<java.lang.StackTraceElement> stack()
          The stack from which the log method was invoked, with the caller on top.
 Option<java.lang.String> text()
          An optional, arbitrary text message to be logged.
 ThreadSnapshot thread()
          A ThreadSnapshot created at the initial log method invocation.
 java.util.Date time()
          The time at which the log method was invoked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogSink.Message

protected LogSink.Message(ThreadSnapshot thread)

LogSink.Message

protected LogSink.Message(ThreadSnapshot thread,
                          java.lang.String text)

LogSink.Message

protected LogSink.Message(LogSink.Message copy)
Method Detail

thread

public ThreadSnapshot thread()
A ThreadSnapshot created at the initial log method invocation.


text

public Option<java.lang.String> text()
An optional, arbitrary text message to be logged.


time

public java.util.Date time()
The time at which the log method was invoked.


caller

public Option<java.lang.StackTraceElement> caller()
The location from which the log method was invoked, if available.


stack

public java.lang.Iterable<java.lang.StackTraceElement> stack()
The stack from which the log method was invoked, with the caller on top.


send

public abstract void send(LogSink sink)

apply

public abstract <T> T apply(LogSink.MessageVisitor<? extends T> visitor)

serializable

public abstract LogSink.Message serializable()
Convert the message to a form that is guaranteed to be serializable (e.g., invokes toString() on objects of arbitrary type).