messagerecorder.html
来自「基于mondrian 开源框架进行OLAP多维分析」· HTML 代码 · 共 668 行 · 第 1/2 页
HTML
668 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_15) on Thu Jul 31 17:20:14 EDT 2008 --><TITLE>MessageRecorder (Mondrian OLAP Server, version 3.0.4.11371)</TITLE><META NAME="keywords" CONTENT="mondrian.recorder.MessageRecorder interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="MessageRecorder (Mondrian OLAP Server, version 3.0.4.11371)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../mondrian/recorder/LoggerRecorder.html" title="class in mondrian.recorder"><B>PREV CLASS</B></A> <A HREF="../../mondrian/recorder/PrintStreamRecorder.html" title="class in mondrian.recorder"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?mondrian/recorder/MessageRecorder.html" target="_top"><B>FRAMES</B></A> <A HREF="MessageRecorder.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">mondrian.recorder</FONT><BR>Interface MessageRecorder</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../mondrian/recorder/AbstractRecorder.html" title="class in mondrian.recorder">AbstractRecorder</A>, <A HREF="../../mondrian/recorder/ListRecorder.html" title="class in mondrian.recorder">ListRecorder</A>, <A HREF="../../mondrian/recorder/LoggerRecorder.html" title="class in mondrian.recorder">LoggerRecorder</A>, <A HREF="../../mondrian/recorder/PrintStreamRecorder.html" title="class in mondrian.recorder">PrintStreamRecorder</A></DD></DL><HR><DL><DT><PRE>public interface <B>MessageRecorder</B></DL></PRE><P>Records warnings and errors during the processing of a task. Contexts can be added and removed. This allows one to collect more than one warning/error, keep processing, and then the code that initiated the processing can determine what to do with the warnings/errors if they exist. <p> A typical usage might be: <pre><code> void process(MessageRecorder msgRecorder) { msgRecorder.pushContextName(getName()); try { // prcess task .... // need to generate warning message String msg = ... msgRecorder.reportWarning(msg); .... } finally { msgRecorder.popContextName(); } } <code></pre> <p> Implementations must provide the means for extracting the error/warning messages. <p> Code that is processing should not catch the MessageRecorder.RTException. This Exception is thrown by the MessageRecorder when too many errors have been seen. Throwing this Exception is the mechanism used to stop processing and return to the initiating code. The initiating code should expect to catch the MessageRecorder.RTException Exception. <pre><code> void initiatingCode(MessageRecorder msgRecorder) { // get MessageRecorder implementation MessageRecorder msgRecorder = .... try { processingCode(msgRecorder); } catch (MessageRecorder.RTException mrex) { // empty } if (msgRecorder.hasErrors()) { // handle errors } else if (msgRecorder.hasWarnings()) { // handle warnings } } <code></pre> <p> The reporting methods all have variations that take an "info" Object. This can be used to pass something, beyond a text message, from the point of warning/error to the initiating code. <p> Concerning logging, it is a rule that a message, if logged by the code creating the MessageRecorder implementation, is logged at is reporting level, errors are logged at the error log level, warnings at the warning level and info at the info level. This allows the client code to "know" what log level their messages might appear at.<P><P><DL><DT><B>Version:</B></DT> <DD>$Id: //open/mondrian-release/3.0/src/main/mondrian/recorder/MessageRecorder.java#2 $</DD><DT><B>Author:</B></DT> <DD>Richard M. Emberson</DD></DL><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#clear()">clear</A></B>()</CODE><BR> Clear all context, warnings and errors from the MessageRecorder.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#getContext()">getContext</A></B>()</CODE><BR> Get the current context string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#getRunTimeMillis()">getRunTimeMillis</A></B>()</CODE><BR> How long the MessageRecorder has been running since it was created or the last time clear was called.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#getStartTimeMillis()">getStartTimeMillis</A></B>()</CODE><BR> Get the time when the MessageRecorder was created or the last time that the clear method was called.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#hasErrors()">hasErrors</A></B>()</CODE><BR> Returns true if there are one or more error messages.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#hasInformation()">hasInformation</A></B>()</CODE><BR> Returns true if there are one or more informational messages.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#hasWarnings()">hasWarnings</A></B>()</CODE><BR> Returns true if there are one or more warning messages.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#popContextName()">popContextName</A></B>()</CODE><BR> Remove the last context name added.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#pushContextName(java.lang.String)">pushContextName</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)</CODE><BR> Add the name parameter to the current context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportError(java.lang.Exception)">reportError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A> ex)</CODE><BR> Add an Exception.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportError(java.lang.Exception, java.lang.Object)">reportError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A> ex, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> info)</CODE><BR> Add an Exception and extra informaton.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportError(java.lang.String)">reportError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg)</CODE><BR> Add an error message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportError(java.lang.String, java.lang.Object)">reportError</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> info)</CODE><BR> Add an error message and extra information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportInfo(java.lang.String)">reportInfo</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg)</CODE><BR> Add an informational message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportInfo(java.lang.String, java.lang.Object)">reportInfo</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> info)</CODE><BR> Add an informational message and extra information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportWarning(java.lang.String)">reportWarning</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg)</CODE><BR> Add a warning message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#reportWarning(java.lang.String, java.lang.Object)">reportWarning</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> info)</CODE><BR> Add a warning message and extra information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../mondrian/recorder/MessageRecorder.html#throwRTException()">throwRTException</A></B>()</CODE><BR> This simply throws a RTException.</TD></TR></TABLE> <P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?