protoj.core.internal
Class ProjectReporter

java.lang.Object
  extended by protoj.core.internal.ProjectReporter

public final class ProjectReporter
extends java.lang.Object

Responds to project events by logging appropriate messages.

Author:
Ashley Williams

Constructor Summary
ProjectReporter(CoreProject core)
          Construct with the parent aggregate of this instance.
 
Method Summary
 void beginCommand(java.lang.String command)
          Logs that a command is about to be executed.
 java.lang.String getHighlightedMessage(java.lang.String message)
          Used to format each message in a standard way.
 org.apache.log4j.Logger getLogger()
           
 boolean isReportingEnabled()
          If we are in the shell script vm then we should report as normal.
 void projectFailed(java.lang.String description)
          Logs that the project command was unsuccessfully executed, using the given description argument.
 void projectFailed(java.lang.Throwable e)
          Logs that the project command was unsuccessfully executed, using the given exception argument.
 void projectSucceeded()
          Logs that the project command was successfully executed.
 void unknownCommand(java.lang.String command)
          Logs that the given command was unknown when an execution was attempted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectReporter

public ProjectReporter(CoreProject core)
Construct with the parent aggregate of this instance.

Parameters:
core -
Method Detail

isReportingEnabled

public boolean isReportingEnabled()
If we are in the shell script vm then we should report as normal. If not then we have been bootstrapped to an implementation vm and so to prevent doubled up messages, reporting needs to be disabled.

Returns:

beginCommand

public void beginCommand(java.lang.String command)
Logs that a command is about to be executed.

Parameters:
command -

unknownCommand

public void unknownCommand(java.lang.String command)
Logs that the given command was unknown when an execution was attempted.

Parameters:
command -

projectSucceeded

public void projectSucceeded()
Logs that the project command was successfully executed.


projectFailed

public void projectFailed(java.lang.Throwable e)
Logs that the project command was unsuccessfully executed, using the given exception argument.

Parameters:
e -

projectFailed

public void projectFailed(java.lang.String description)
Logs that the project command was unsuccessfully executed, using the given description argument. Additionally reports to stderr.

Parameters:
description -

getHighlightedMessage

public java.lang.String getHighlightedMessage(java.lang.String message)
Used to format each message in a standard way.

Parameters:
message -
Returns:

getLogger

public org.apache.log4j.Logger getLogger()