org.lexevs.logging.messaging.impl
Class CachingMessageDirectorImpl

java.lang.Object
  extended by org.lexevs.logging.messaging.impl.CachingMessageDirectorImpl
All Implemented Interfaces:
CachingMessageDirectorIF, LgMessageDirectorIF
Direct Known Subclasses:
SpringBatchMessageDirector

public class CachingMessageDirectorImpl
extends java.lang.Object
implements CachingMessageDirectorIF

The class implements the CachingMessageDirectorIF interface and is used to log the messages generated by programs into a Collection so they can be easily retrieved for later use. This takes in another LgMessageDirectorIF - all messages are passed down to this message director for further action.

Author:
Deepak Sharma, Pradip Kanjamala, Dan Armbrust

Field Summary
protected  LgMessageDirectorIF baseMessageDirector_
          The base message director_.
 
Constructor Summary
CachingMessageDirectorImpl(LgMessageDirectorIF msgDirector)
          Instantiates a new caching message director impl.
 
Method Summary
 void busy()
          Output to indicate system is busy - spin a cursor, print a dot, etc.
 void clearLog()
          Clear log.
 java.lang.String debug(java.lang.String message)
          Take a debug message.
 java.lang.String error(java.lang.String message)
          Display a non-fatal error to the user.
 java.lang.String error(java.lang.String message, java.lang.Throwable cause)
          Display a non-fatal error to the user
 java.lang.String fatal(java.lang.String message)
          Display a fatal error to the user.
 java.lang.String fatal(java.lang.String message, java.lang.Throwable cause)
          Display a fatal error to the user.
 void fatalAndThrowException(java.lang.String message)
          Display a fatal error to the user - and then throw an exception.
 void fatalAndThrowException(java.lang.String message, java.lang.Throwable sourceException)
          Display a fatal error to the user - and then throw an exception.
 LogEntry[] getLog(LogLevel level)
          Gets the LogEntries given a specified LogLevel.
 java.lang.String info(java.lang.String message)
          Displays a status type of message (not an error or a warning)
 java.lang.String warn(java.lang.String message)
          Display a warning to the user.
 java.lang.String warn(java.lang.String message, java.lang.Throwable cause)
          Display a warning to the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseMessageDirector_

protected LgMessageDirectorIF baseMessageDirector_
The base message director_.

Constructor Detail

CachingMessageDirectorImpl

public CachingMessageDirectorImpl(LgMessageDirectorIF msgDirector)
Instantiates a new caching message director impl.

Parameters:
msgDirector - the msg director
Method Detail

debug

public java.lang.String debug(java.lang.String message)
Description copied from interface: LgMessageDirectorIF
Take a debug message.

Specified by:
debug in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

error

public java.lang.String error(java.lang.String message,
                              java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a non-fatal error to the user

Specified by:
error in interface LgMessageDirectorIF
cause - The source exception that caused the error.

error

public java.lang.String error(java.lang.String message)
Description copied from interface: LgMessageDirectorIF
Display a non-fatal error to the user.

Specified by:
error in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

fatal

public java.lang.String fatal(java.lang.String message,
                              java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user.

Specified by:
fatal in interface LgMessageDirectorIF
cause - The source exception that caused the error.
Returns:
Implementations may return a string, such as a log id.

fatal

public java.lang.String fatal(java.lang.String message)
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user.

Specified by:
fatal in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

info

public java.lang.String info(java.lang.String message)
Description copied from interface: LgMessageDirectorIF
Displays a status type of message (not an error or a warning)

Specified by:
info in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

warn

public java.lang.String warn(java.lang.String message,
                             java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a warning to the user

Specified by:
warn in interface LgMessageDirectorIF
cause - The source exception that caused the warning
Returns:
Implementations may return a string, such as a log id.

warn

public java.lang.String warn(java.lang.String message)
Description copied from interface: LgMessageDirectorIF
Display a warning to the user.

Specified by:
warn in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

busy

public void busy()
Description copied from interface: LgMessageDirectorIF
Output to indicate system is busy - spin a cursor, print a dot, etc.

Specified by:
busy in interface LgMessageDirectorIF

fatalAndThrowException

public void fatalAndThrowException(java.lang.String message)
                            throws java.lang.Exception
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user - and then throw an exception.

Specified by:
fatalAndThrowException in interface LgMessageDirectorIF
Throws:
java.lang.Exception

fatalAndThrowException

public void fatalAndThrowException(java.lang.String message,
                                   java.lang.Throwable sourceException)
                            throws java.lang.Exception
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user - and then throw an exception.

Specified by:
fatalAndThrowException in interface LgMessageDirectorIF
sourceException - The source exception that caused the error.
Throws:
java.lang.Exception

clearLog

public void clearLog()
Description copied from interface: CachingMessageDirectorIF
Clear log.

Specified by:
clearLog in interface CachingMessageDirectorIF

getLog

public LogEntry[] getLog(LogLevel level)
Description copied from interface: CachingMessageDirectorIF
Gets the LogEntries given a specified LogLevel.

Specified by:
getLog in interface CachingMessageDirectorIF
Parameters:
level - the level
Returns:
the log

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.