|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.recorder.AbstractRecorder
public abstract class AbstractRecorder
Abstract implemention of the MessageRecorder interface.
| Nested Class Summary | |
|---|---|
(package private) static class |
AbstractRecorder.MsgType
|
| Field Summary | |
|---|---|
static int |
DEFAULT_MSG_LIMIT
|
| Constructor Summary | |
|---|---|
protected |
AbstractRecorder()
|
protected |
AbstractRecorder(int errorMsgLimit)
|
| Method Summary | |
|---|---|
void |
clear()
Resets this MessageRecorder. |
String |
getContext()
Get the current context string. |
int |
getErrorCount()
|
int |
getInfoCount()
|
long |
getRunTimeMillis()
How long the MessageRecorder has been running since it was created or the last time clear was called. |
long |
getStartTimeMillis()
Get the time when the MessageRecorder was created or the last time that the clear method was called. |
int |
getWarningCount()
|
boolean |
hasErrors()
Returns true if there are one or more error messages. |
boolean |
hasInformation()
Returns true if there are one or more informational messages. |
boolean |
hasWarnings()
Returns true if there are one or more warning messages. |
static void |
logMessage(String context,
String msg,
AbstractRecorder.MsgType msgType,
org.apache.log4j.Logger logger)
Helper method to format a message and write to logger. |
void |
popContextName()
Remove the last context name added. |
void |
pushContextName(String name)
Add the name parameter to the current context. |
protected abstract void |
recordMessage(String msg,
Object info,
AbstractRecorder.MsgType msgType)
Handles a message. |
void |
reportError(Exception ex)
Add an Exception. |
void |
reportError(Exception ex,
Object info)
Add an Exception and extra informaton. |
void |
reportError(String msg)
Add an error message. |
void |
reportError(String msg,
Object info)
Add an error message and extra information. |
void |
reportInfo(String msg)
Add an informational message. |
void |
reportInfo(String msg,
Object info)
Add an informational message and extra information. |
void |
reportWarning(String msg)
Add a warning message. |
void |
reportWarning(String msg,
Object info)
Add a warning message and extra information. |
void |
throwRTException()
This simply throws a RTException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MSG_LIMIT
| Constructor Detail |
|---|
protected AbstractRecorder()
protected AbstractRecorder(int errorMsgLimit)
| Method Detail |
|---|
public static void logMessage(String context,
String msg,
AbstractRecorder.MsgType msgType,
org.apache.log4j.Logger logger)
public void clear()
clear in interface MessageRecorderpublic long getStartTimeMillis()
MessageRecorder
getStartTimeMillis in interface MessageRecorderpublic long getRunTimeMillis()
MessageRecorder
getRunTimeMillis in interface MessageRecorderpublic boolean hasInformation()
MessageRecorder
hasInformation in interface MessageRecorderpublic boolean hasWarnings()
MessageRecorder
hasWarnings in interface MessageRecorderpublic boolean hasErrors()
MessageRecorder
hasErrors in interface MessageRecorderpublic int getInfoCount()
public int getWarningCount()
public int getErrorCount()
public String getContext()
MessageRecorder
getContext in interface MessageRecorderpublic void pushContextName(String name)
MessageRecorder
pushContextName in interface MessageRecorderpublic void popContextName()
MessageRecorder
popContextName in interface MessageRecorder
public void throwRTException()
throws RecorderException
MessageRecorder
throwRTException in interface MessageRecorderRecorderException
public void reportError(Exception ex)
throws RecorderException
MessageRecorder
reportError in interface MessageRecorderex - the Exception added.
RecorderException - if too many error messages have been added.
public void reportError(Exception ex,
Object info)
throws RecorderException
MessageRecorder
reportError in interface MessageRecorderex - the Exception added.info - extra information (not meant to be part of printed message)
RecorderException - if too many error messages have been added.
public void reportError(String msg)
throws RecorderException
MessageRecorder
reportError in interface MessageRecordermsg - the text of the error message.
RecorderException - if too many error messages have been added.
public void reportError(String msg,
Object info)
throws RecorderException
MessageRecorder
reportError in interface MessageRecordermsg - the text of the error message.info - extra information (not meant to be part of printed message)
RecorderException - if too many error messages have been added.public void reportWarning(String msg)
MessageRecorder
reportWarning in interface MessageRecordermsg - the text of the warning message.
public void reportWarning(String msg,
Object info)
MessageRecorder
reportWarning in interface MessageRecordermsg - the text of the warning message.info - extra information (not meant to be part of printed message)public void reportInfo(String msg)
MessageRecorder
reportInfo in interface MessageRecordermsg - the text of the info message.
public void reportInfo(String msg,
Object info)
MessageRecorder
reportInfo in interface MessageRecordermsg - the text of the info message.info - extra information (not meant to be part of printed message)
protected abstract void recordMessage(String msg,
Object info,
AbstractRecorder.MsgType msgType)
msg - the error or warning message.info - the information Object which might be null.msgType - one of the message type enum values
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||