Expresso 5-6

com.jcorporate.expresso.core.controller
Class ControllerInstallLog

java.lang.Object
  extended bycom.jcorporate.expresso.core.controller.ControllerInstallLog
All Implemented Interfaces:
InstallLog

public class ControllerInstallLog
extends Object
implements InstallLog

This is an implementation of the IntallLog interface that is useful when running installation systems inside controllers. It renders the log messages as a series of outputs with the following rules:

first before using the log or

Author:
Michael Rimov
See Also:
InstallLog, ConsoleInstallLog

Field Summary
protected  Block parentBlock
           
protected  ControllerResponse response
           
 
Constructor Summary
protected ControllerInstallLog()
          The point is that we don't want the default constructor used.
  ControllerInstallLog(ControllerResponse theResponse)
          Constructs a ControllerInstallLog and sets the ControllerResponse that we will be using to add the outputs to.
 
Method Summary
protected  void addNestedOutputs(Output o, Throwable error)
          Adds the exceptions as nested outputs to the original log message
protected  void addOutput(Output logMessage)
          Helper method that adds the output to either the parent block or the controller response, depending on what was needed
 void debug(String message)
          Log a debug message
 void error(String message)
          Log an error message
 void error(String message, Throwable error)
          Log an error exception
 void info(String message)
          Log an info message
 void setParentBlock(Block b)
          Optional method.
 void warn(String message)
          Log a warning message
 void warn(String message, Throwable error)
          Log a warning exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

protected ControllerResponse response

parentBlock

protected Block parentBlock
Constructor Detail

ControllerInstallLog

public ControllerInstallLog(ControllerResponse theResponse)
Constructs a ControllerInstallLog and sets the ControllerResponse that we will be using to add the outputs to.

Parameters:
theResponse -

ControllerInstallLog

protected ControllerInstallLog()
The point is that we don't want the default constructor used.

Method Detail

setParentBlock

public void setParentBlock(Block b)
Optional method. If you want the outputs to be added to a block rather than the root of the ControllerResponse then call setParentBlock() before usage

Parameters:
b - the block you wish to use.

addOutput

protected void addOutput(Output logMessage)
Helper method that adds the output to either the parent block or the controller response, depending on what was needed

Parameters:
logMessage - the output to add

debug

public void debug(String message)
Log a debug message

Specified by:
debug in interface InstallLog
Parameters:
message - The message to log.

info

public void info(String message)
Log an info message

Specified by:
info in interface InstallLog
Parameters:
message - The message to log.

warn

public void warn(String message)
Log a warning message

Specified by:
warn in interface InstallLog
Parameters:
message - The message to log.

warn

public void warn(String message,
                 Throwable error)
Log a warning exception

Specified by:
warn in interface InstallLog
Parameters:
message - The message to log.
error - The Throwable object to log

error

public void error(String message,
                  Throwable error)
Log an error exception

Specified by:
error in interface InstallLog
Parameters:
message - The message to log.
error - The Throwable object to log

error

public void error(String message)
Log an error message

Specified by:
error in interface InstallLog
Parameters:
message - The message to log.

addNestedOutputs

protected void addNestedOutputs(Output o,
                                Throwable error)
Adds the exceptions as nested outputs to the original log message

Parameters:
o - the original log message
error - the exception to log as well.

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.