org.echarts.monitor
Class PrettyPrintFormatter

java.lang.Object
  extended by org.echarts.monitor.PrettyPrintFormatter
All Implemented Interfaces:
PrintStreamFormatter
Direct Known Subclasses:
EChartsSipServletMonitorFormatter

public class PrettyPrintFormatter
extends java.lang.Object
implements PrintStreamFormatter

Class defining method for portraying a monitor event in multi-line, human-readable format.


Field Summary
protected static java.text.SimpleDateFormat EVENT_DATE_FORMAT
          Date format used for event date stamps.
protected static java.lang.String LINESEP
           
 
Constructor Summary
PrettyPrintFormatter()
           
 
Method Summary
 boolean multiLineLocalState(boolean multiLineLocalState)
          When set, local machine state is printed one state per line.
 boolean packageNames(boolean packageNames)
          When set, package name prefixes are included in class name values in machine debug events e.g.
 java.lang.String portray(MachineMonitorEvent event)
          When method accepted by monitor's event filter, this method called to pretty print the event.
 java.lang.String portrayClass(java.lang.String className)
          References packageNames flag to determine how class names should be portrayed.
 java.lang.StringBuffer portrayInfoEvent(InfoEvent event)
          Pretty print an info event.
 java.lang.StringBuffer portrayLocalState(java.lang.String localState)
          References multiLineLocalState flag to determine how local state should be portrayed.
 java.lang.StringBuffer portrayMachineLifecycleEvent(MachineLifecycleEvent event)
          Pretty print a machine lifecycle event.
 java.lang.StringBuffer portrayMachineStateEvent(MachineStateEvent event)
          Pretty print a machine state event.
 java.lang.StringBuffer portrayMessagelessTransitionEvent(MessagelessTransitionEvent event)
          Pretty print a messageless transition event.
 java.lang.StringBuffer portrayMessageTransitionEvent(MessageTransitionEvent event)
          Pretty print a message transition event.
 java.lang.StringBuffer portrayOtherEvent(MachineMonitorEvent event)
          Pretty print a non-ECharts event.
 java.lang.StringBuffer portrayOtherEventProperties(MachineMonitorEvent event, java.lang.String[] props)
          Pretty print non-ECharts properties associated with a non-ECharts event.
 java.lang.StringBuffer portrayState(java.lang.String stateString)
          Pretty print a machine state string.
 java.lang.StringBuffer portrayStateIndent(int depth)
          Return padding string to indent states at specified depth.
 java.lang.String portrayStatePath(java.lang.String statePath)
          Pretty print a machine state path string.
 boolean statePathMachineNames(boolean statePathMachineNames)
          When set, external machine class names prefix their associated state names in the portrayal of machine state paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINESEP

protected static final java.lang.String LINESEP

EVENT_DATE_FORMAT

protected static final java.text.SimpleDateFormat EVENT_DATE_FORMAT
Date format used for event date stamps.

Constructor Detail

PrettyPrintFormatter

public PrettyPrintFormatter()
Method Detail

packageNames

public final boolean packageNames(boolean packageNames)
When set, package name prefixes are included in class name values in machine debug events e.g. in machine class names, message class names etc. When cleared, package names are not printed. Returns previous value.


statePathMachineNames

public final boolean statePathMachineNames(boolean statePathMachineNames)
When set, external machine class names prefix their associated state names in the portrayal of machine state paths. When cleared, machine names are excluded and only state names are printed. Returns previous value.


multiLineLocalState

public final boolean multiLineLocalState(boolean multiLineLocalState)
When set, local machine state is printed one state per line. When cleared, the machine state is printed on a single line. Returns previous value.


portray

public java.lang.String portray(MachineMonitorEvent event)
When method accepted by monitor's event filter, this method called to pretty print the event. Non-machine debug events are simply printed as "Key: Value" pairs on separate lines. To customize printing of non-machine debug events, subclass this class and override this method.

Specified by:
portray in interface PrintStreamFormatter

portrayMessagelessTransitionEvent

public java.lang.StringBuffer portrayMessagelessTransitionEvent(MessagelessTransitionEvent event)
Pretty print a messageless transition event.


portrayMessageTransitionEvent

public java.lang.StringBuffer portrayMessageTransitionEvent(MessageTransitionEvent event)
Pretty print a message transition event.


portrayMachineStateEvent

public java.lang.StringBuffer portrayMachineStateEvent(MachineStateEvent event)
Pretty print a machine state event.


portrayMachineLifecycleEvent

public java.lang.StringBuffer portrayMachineLifecycleEvent(MachineLifecycleEvent event)
Pretty print a machine lifecycle event.


portrayInfoEvent

public java.lang.StringBuffer portrayInfoEvent(InfoEvent event)
Pretty print an info event.


portrayOtherEvent

public java.lang.StringBuffer portrayOtherEvent(MachineMonitorEvent event)
Pretty print a non-ECharts event.


portrayOtherEventProperties

public java.lang.StringBuffer portrayOtherEventProperties(MachineMonitorEvent event,
                                                          java.lang.String[] props)
Pretty print non-ECharts properties associated with a non-ECharts event.


portrayState

public java.lang.StringBuffer portrayState(java.lang.String stateString)
Pretty print a machine state string.


portrayStateIndent

public java.lang.StringBuffer portrayStateIndent(int depth)
Return padding string to indent states at specified depth.


portrayLocalState

public java.lang.StringBuffer portrayLocalState(java.lang.String localState)
References multiLineLocalState flag to determine how local state should be portrayed.


portrayStatePath

public java.lang.String portrayStatePath(java.lang.String statePath)
Pretty print a machine state path string.


portrayClass

public java.lang.String portrayClass(java.lang.String className)
References packageNames flag to determine how class names should be portrayed.