org.ceryle.util
Interface MessageHandler

All Known Implementing Classes:
MessageHandlerImpl

public interface MessageHandler

A simple API for a message handler.

There are seven types of message, plus a localize method:

variable state description
localizenormal returns localized version of message.
status normal writes localized message to status (UI if available, message if not).
log normal writes timestamped, localized message to log file.
message normal writes localized message to designated output.
notice normal writes localized notice to designated output.
warning error writes localized warning message to designated output and performs a system exit if the warning count exceeds maxWarnings.
error error writes localized error message to designated output and performs a system exit if the error count exceeds maxErrors.
fatal error writes localized error message to stderr and performs a system exit.

Notes:

The first method parameter id may be a MessageId reference from the localized ListResourceBundle Messages, or if not recognized as such, will be treated simply as a message String. Following the initial id, each of the four message types is available with one to four additional passed parameters, plus several include exception tunnelling (for compliance with SAX's ErrorHandler). While there is considerable flexibility in available methods, the minimum pattern followed for all is similar to message():

    public String message( String id )
    public String message( String id, String arg1 )
    public String message( String id, String arg1, String arg2 )
    public String message( String id, String arg1, String arg2, String arg3 )
    etc.
 

localize(String) is also available with as many as six parameters.

State Constants and Log4J Levels

MessageHandler uses a set of state constants (OK through FATAL), which partially overlap in functionality with Log4J levels so that they can be used as command line parameters. If a state value overlaps, it is described as such in each constant's documentation. There is a static conversion utility in MessageHandlerImpl to convert MessageHandler state values to Log4J Levels. The API itself has no dependency on Log4J.

Since:
JDK1.3
Version:
$Id: MessageHandler.java,v 3.15 2007-06-15 12:09:56 altheim Exp $
Author:
Murray Altheim

Field Summary
static int DEBUG
          Not used as a state: Log4J Level = DEBUG.
static int ERROR
          State: process error (possibly recoverable).
static int FATAL
          State: exit immediately on receiving.
static int INFO
          State: informational message.
static int LOCALIZE
          State: return localized message.
static int LOG
          State: log message.
static String LOG_FEATURE_PFX
          Logger Feature prefix.
static String LOG_LEVEL
          Feature identifier: message/log (noise) level.
static String MESSAGE_VERBOSE
          Feature identifier: log append.
static String MSG_PROPERTY_PFX
          MessageHandler Feature prefix.
static int NOTICE
          State: highlighted notice.
static int OFF
          Not used as a state: Log4J Level = OFF (i.e., logging off).
static int OK
          State: no activity.
static int WARN
          State: warning message.
 
Method Summary
 void active()
          Indicates any kind of application activity, and should be by implementing classes upon any system message sent to the MessageHandler (except requests for localization).
 String error(Exception exception)
          Tunnel an existing Exception.
 String error(String id)
          Handle an exception provided an error message and no arguments.
 String error(String id, Exception exception)
          Handle an exception provided an error message and no arguments, and the tunneled Exception.
 String error(String id, String arg)
          Handle an exception provided an error message and one argument.
 String error(String id, String arg, Exception exception)
          Handle an exception provided an error message with one argument and the tunneled Exception.
 String error(String id, String arg1, String arg2)
          Handle an exception provided an error message and two arguments.
 String error(String id, String arg1, String arg2, Exception exception)
          Handle an exception provided an error message with two arguments and the tunneled Exception.
 String error(String id, String arg1, String arg2, String arg3)
          Handle an exception provided an error message and three arguments.
 String fatalError(Error error)
          A method which handles a fatal error provided the actual java.lang.Error.
 String fatalError(Exception exception)
          A method which handles a fatal exception given the tunneled Exception.
 String fatalError(String id)
          A method which handles a fatal exception given an error message String.
 String fatalError(String id, Exception exception)
          A method which handles a fatal exception given an error message String and the tunneled Exception.
 String fatalError(String id, String arg1)
          A method which handles a fatal exception given an error id, one argument.
 String fatalError(String id, String arg1, Exception exception)
          A method which handles a fatal exception given an error id, one argument, and the tunneled Exception.
 String fatalError(String id, String arg1, String arg2)
          A method which handles a fatal exception given an error id and two arguments.
 String fatalError(String id, String arg1, String arg2, Exception exception)
          A method which handles a fatal exception given an error id, two arguments, and the tunneled Exception.
 Clock getClock()
          Returns the Clock object used for generating timestamps.
 int getStatus()
          Return the current MessageHandler status.
 String getStatusText(int status)
          Returns a localized String indicating the provided message status.
 Writer getWriter()
          Returns the Writer used.
 String localize(String id)
          Return a localized message given a message id and no arguments.
 String localize(String id, String arg1)
          Return a localized message given a message id and one argument.
 String localize(String id, String arg1, String arg2)
          Return a localized message given a message id and two arguments.
 String localize(String id, String arg1, String arg2, String arg3)
          Return a localized message given a message id and three arguments.
 String localize(String id, String arg1, String arg2, String arg3, String arg4)
          Return a localized message given a message id and four arguments.
 String localize(String id, String arg1, String arg2, String arg3, String arg4, String arg5)
          Return a localized message given a message id and five arguments.
 String localize(String id, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6)
          Return a localized message given a message id and six arguments.
 String log(String message)
          Write the message to the log file, given the message and no arguments.
 String log(String timeStamp, String id)
          Write the message to the log file, given an optional time stamp, a message id and no arguments.
 String log(String timeStamp, String id, String arg1)
          Write the message to the log file, given an optional time stamp, a message id and one argument.
 String log(String timeStamp, String id, String arg1, String arg2)
          Write the message to the log file, given an optional time stamp, a message id and two arguments.
 String log(String timeStamp, String id, String arg1, String arg2, String arg3)
          Write the message to the log file, given an optional time stamp, a message id and three arguments.
 String log(String timeStamp, String id, String arg1, String arg2, String arg3, String arg4)
          Write the message to the log file, given an optional time stamp, a message id and four arguments.
 String message(String id)
          Display a non-fatal informational message given a message id and no arguments.
 String message(String id, String arg1)
          Display a non-fatal informational message given a message id and one argument.
 String message(String id, String arg1, String arg2)
          Display a non-fatal informational message given a message id and two arguments.
 String message(String id, String arg1, String arg2, String arg3)
          Display a non-fatal informational message given a message id and three arguments.
 String message(String id, String arg1, String arg2, String arg3, String arg4)
          Display a non-fatal informational message given a message id and four arguments.
 String notice(String id)
          Display a highlighted notice given a notice id and no arguments.
 String notice(String id, String arg1)
          Display a highlighted notice given a notice id and one argument.
 String notice(String id, String arg1, String arg2)
          Display a highlighted notice given a notice id and two arguments.
 String notice(String id, String arg1, String arg2, String arg3)
          Display a highlighted notice given a notice id and three arguments.
 String notice(String id, String arg1, String arg2, String arg3, String arg4)
          Display a highlighted notice given a notice id and four arguments.
 void printStackTrace(Throwable throwable)
          Prints the stack trace from the provided Throwable to the error output.
 void registerListener(MessageWriter msgwriter)
          Registers the provided object wi as the receiver for MessageHandler messaging events.
 void reset()
          Clears all warning and error counters and containers.
 void status(String id)
          Display a status message to the UI if available (as a message if not) given a message id and no arguments.
 void status(String id, String arg1)
          Display a status message to the UI if available (as a message if not) given a message id and one argument.
 void status(String id, String arg1, String arg2)
          Display a status message to the UI if available (as a message if not) given a message id and two arguments.
 void status(String id, String arg1, String arg2, String arg3)
          Display a status message to the UI if available (as a message if not) given a message id and three arguments.
 void status(String id, String arg1, String arg2, String arg3, String arg4)
          Display a status message to the UI if available (as a message if not) given a message id and four arguments.
 String warning(Exception exception)
          Tunnel an existing Exception.
 String warning(String id)
          Display a non-fatal warning given an error message and no arguments.
 String warning(String id, String arg1)
          Display a non-fatal warning given an error id and one argument.
 String warning(String id, String arg1, String arg2)
          Display a non-fatal warning given an error id and two arguments.
 String warning(String id, String arg1, String arg2, String arg3)
          Display a non-fatal warning given an error id and three arguments.
 String writeMessage(int status, String message)
          Write the contents of the message to a message display with any indication of message type provided by the status parameter, whose values are one of the state values from MessageHandler.
 void writeMessage(String message)
          Writes the error message using the defined Writer.
 void writeStatus(String message)
          Display an informational message given a message String, using the defined Writer.
 

Field Detail

MSG_PROPERTY_PFX

static final String MSG_PROPERTY_PFX
MessageHandler Feature prefix.

See Also:
Constant Field Values

MESSAGE_VERBOSE

static final String MESSAGE_VERBOSE
Feature identifier: log append.

See Also:
Constant Field Values

LOG_FEATURE_PFX

static final String LOG_FEATURE_PFX
Logger Feature prefix. (copied from org.ceryle.util.log.Logger)

See Also:
Constant Field Values

LOG_LEVEL

static final String LOG_LEVEL
Feature identifier: message/log (noise) level.

See Also:
Constant Field Values

OK

static final int OK
State: no activity. Log4J Level = ALL (i.e., all messages).

See Also:
Constant Field Values

LOCALIZE

static final int LOCALIZE
State: return localized message.

See Also:
Constant Field Values

DEBUG

static final int DEBUG
Not used as a state: Log4J Level = DEBUG.

See Also:
Constant Field Values

LOG

static final int LOG
State: log message.

See Also:
Constant Field Values

INFO

static final int INFO
State: informational message. Log4J Level = INFO.

See Also:
Constant Field Values

NOTICE

static final int NOTICE
State: highlighted notice.

See Also:
Constant Field Values

WARN

static final int WARN
State: warning message. Log4J Level = WARN.

See Also:
Constant Field Values

ERROR

static final int ERROR
State: process error (possibly recoverable). Log4J Level = ERROR.

See Also:
Constant Field Values

FATAL

static final int FATAL
State: exit immediately on receiving. Log4J Level = FATAL.

See Also:
Constant Field Values

OFF

static final int OFF
Not used as a state: Log4J Level = OFF (i.e., logging off).

See Also:
Constant Field Values
Method Detail

registerListener

void registerListener(MessageWriter msgwriter)
Registers the provided object wi as the receiver for MessageHandler messaging events.


writeStatus

void writeStatus(String message)
Display an informational message given a message String, using the defined Writer.

This is also a MessageWriter API method.


writeMessage

String writeMessage(int status,
                    String message)
Write the contents of the message to a message display with any indication of message type provided by the status parameter, whose values are one of the state values from MessageHandler.

This is also a MessageWriter API method.

Returns:
the processed message, including any changes made.

writeMessage

void writeMessage(String message)
Writes the error message using the defined Writer.

This is also a MessageWriter API method.


printStackTrace

void printStackTrace(Throwable throwable)
Prints the stack trace from the provided Throwable to the error output.


getWriter

Writer getWriter()
Returns the Writer used.


getClock

Clock getClock()
Returns the Clock object used for generating timestamps.


localize

String localize(String id)
Return a localized message given a message id and no arguments. Note that the id can simply be a text message.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1)
Return a localized message given a message id and one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1,
                String arg2)
Return a localized message given a message id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1,
                String arg2,
                String arg3)
Return a localized message given a message id and three arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1,
                String arg2,
                String arg3,
                String arg4)
Return a localized message given a message id and four arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1,
                String arg2,
                String arg3,
                String arg4,
                String arg5)
Return a localized message given a message id and five arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
arg5 - argument substituting %5 in the message string.
Returns:
a localized version of the message.

localize

String localize(String id,
                String arg1,
                String arg2,
                String arg3,
                String arg4,
                String arg5,
                String arg6)
Return a localized message given a message id and six arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
arg5 - argument substituting %5 in the message string.
arg6 - argument substituting %5 in the message string.
Returns:
a localized version of the message.

log

String log(String message)
Write the message to the log file, given the message and no arguments. Note that as apart from most methods in this class, the message is not localized but simply passed to the handler. The log timestamp will be added. If the log file has not been established, nothing happens.

Parameters:
message - the message to be written to the log file.
Returns:
the original message.

log

String log(String timeStamp,
           String id)
Write the message to the log file, given an optional time stamp, a message id and no arguments. Note that the id can simply be a text message. If the log file has not been established, nothing happens.

Parameters:
timeStamp - the optional time stamp string to be added to the log.
id - the String or the ID of the message to be written to the log file.
Returns:
a localized version of the message.

log

String log(String timeStamp,
           String id,
           String arg1)
Write the message to the log file, given an optional time stamp, a message id and one argument. If the log file has not been established, nothing happens.

Parameters:
timeStamp - the optional time stamp string to be added to the log.
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the message.

log

String log(String timeStamp,
           String id,
           String arg1,
           String arg2)
Write the message to the log file, given an optional time stamp, a message id and two arguments. If the log file has not been established, nothing happens.

Parameters:
timeStamp - the optional time stamp string to be added to the log.
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

log

String log(String timeStamp,
           String id,
           String arg1,
           String arg2,
           String arg3)
Write the message to the log file, given an optional time stamp, a message id and three arguments. If the log file has not been established, nothing happens.

Parameters:
timeStamp - the optional time stamp string to be added to the log.
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the message.

log

String log(String timeStamp,
           String id,
           String arg1,
           String arg2,
           String arg3,
           String arg4)
Write the message to the log file, given an optional time stamp, a message id and four arguments. If the log file has not been established, nothing happens.

Parameters:
timeStamp - the optional time stamp string to be added to the log.
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
Returns:
a localized version of the message.

status

void status(String id)
Display a status message to the UI if available (as a message if not) given a message id and no arguments. Note that the id can simply be a text message.

Parameters:
id - the MessageId within the ListResourceBundle Messages.

status

void status(String id,
            String arg1)
Display a status message to the UI if available (as a message if not) given a message id and one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.

status

void status(String id,
            String arg1,
            String arg2)
Display a status message to the UI if available (as a message if not) given a message id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.

status

void status(String id,
            String arg1,
            String arg2,
            String arg3)
Display a status message to the UI if available (as a message if not) given a message id and three arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.

status

void status(String id,
            String arg1,
            String arg2,
            String arg3,
            String arg4)
Display a status message to the UI if available (as a message if not) given a message id and four arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.

message

String message(String id)
Display a non-fatal informational message given a message id and no arguments. Note that the id can simply be a text message.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the message.

message

String message(String id,
               String arg1)
Display a non-fatal informational message given a message id and one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the message.

message

String message(String id,
               String arg1,
               String arg2)
Display a non-fatal informational message given a message id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

message

String message(String id,
               String arg1,
               String arg2,
               String arg3)
Display a non-fatal informational message given a message id and three arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the message.

message

String message(String id,
               String arg1,
               String arg2,
               String arg3,
               String arg4)
Display a non-fatal informational message given a message id and four arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
Returns:
a localized version of the message.

notice

String notice(String id)
Display a highlighted notice given a notice id and no arguments. Note that the id can simply be a text notice.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the notice.

notice

String notice(String id,
              String arg1)
Display a highlighted notice given a notice id and one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the notice.

notice

String notice(String id,
              String arg1,
              String arg2)
Display a highlighted notice given a notice id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the notice.

notice

String notice(String id,
              String arg1,
              String arg2,
              String arg3)
Display a highlighted notice given a notice id and three arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the notice.

notice

String notice(String id,
              String arg1,
              String arg2,
              String arg3,
              String arg4)
Display a highlighted notice given a notice id and four arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
arg4 - argument substituting %4 in the message string.
Returns:
a localized version of the notice.

warning

String warning(String id)
Display a non-fatal warning given an error message and no arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the message.

warning

String warning(Exception exception)
Tunnel an existing Exception. Displays a non-fatal warning.

Parameters:
exception - the tunneled Exception.
Returns:
a localized version of the message.

warning

String warning(String id,
               String arg1)
Display a non-fatal warning given an error id and one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the message.

warning

String warning(String id,
               String arg1,
               String arg2)
Display a non-fatal warning given an error id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

warning

String warning(String id,
               String arg1,
               String arg2,
               String arg3)
Display a non-fatal warning given an error id and three arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the message.

error

String error(String id)
Handle an exception provided an error message and no arguments. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the message.

error

String error(Exception exception)
Tunnel an existing Exception. This error may be recoverable with error handling code in specific contexts.

Parameters:
exception - the tunneled Exception.
Returns:
a localized version of the message.

error

String error(String id,
             Exception exception)
Handle an exception provided an error message and no arguments, and the tunneled Exception. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
exception - the tunneled Exception.
Returns:
a localized version of the message.

error

String error(String id,
             String arg)
Handle an exception provided an error message and one argument. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg - argument substituting %1 in the message string.
Returns:
a localized version of the message.

error

String error(String id,
             String arg,
             Exception exception)
Handle an exception provided an error message with one argument and the tunneled Exception. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg - argument substituting %1 in the message string.
exception - the tunneled Exception.
Returns:
a localized version of the message.

error

String error(String id,
             String arg1,
             String arg2)
Handle an exception provided an error message and two arguments. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

error

String error(String id,
             String arg1,
             String arg2,
             String arg3)
Handle an exception provided an error message and three arguments. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
arg3 - argument substituting %3 in the message string.
Returns:
a localized version of the message.

error

String error(String id,
             String arg1,
             String arg2,
             Exception exception)
Handle an exception provided an error message with two arguments and the tunneled Exception. This error may be recoverable with error handling code in specific contexts.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
exception - the tunneled Exception.
Returns:
a localized version of the message.

fatalError

String fatalError(Exception exception)
A method which handles a fatal exception given the tunneled Exception.

Parameters:
exception - the tunneled Exception.
Returns:
a localized version of the message.

fatalError

String fatalError(Error error)
A method which handles a fatal error provided the actual java.lang.Error.

Parameters:
error - the Error thrown.
Returns:
the error message.

fatalError

String fatalError(String id)
A method which handles a fatal exception given an error message String.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
Returns:
a localized version of the message.

fatalError

String fatalError(String id,
                  Exception exception)
A method which handles a fatal exception given an error message String and the tunneled Exception.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
exception - the tunneled Exception.
Returns:
a localized version of the message.

fatalError

String fatalError(String id,
                  String arg1)
A method which handles a fatal exception given an error id, one argument.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
Returns:
a localized version of the message.

fatalError

String fatalError(String id,
                  String arg1,
                  Exception exception)
A method which handles a fatal exception given an error id, one argument, and the tunneled Exception.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
exception - the tunneled Exception.
Returns:
a localized version of the message.

fatalError

String fatalError(String id,
                  String arg1,
                  String arg2)
A method which handles a fatal exception given an error id and two arguments.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
Returns:
a localized version of the message.

fatalError

String fatalError(String id,
                  String arg1,
                  String arg2,
                  Exception exception)
A method which handles a fatal exception given an error id, two arguments, and the tunneled Exception.

Parameters:
id - the MessageId within the ListResourceBundle Messages.
arg1 - argument substituting %1 in the message string.
arg2 - argument substituting %2 in the message string.
exception - the tunneled Exception.
Returns:
a localized version of the message.

active

void active()
Indicates any kind of application activity, and should be by implementing classes upon any system message sent to the MessageHandler (except requests for localization).


reset

void reset()
Clears all warning and error counters and containers.


getStatus

int getStatus()
Return the current MessageHandler status. Available states:
OK
no activity
LOG
a log message has occurred.
INFO
an informational message has occurred.
NOTICE
a highlighted notice has occurred.
WARN
a warning message has occurred.
ERROR
a (possibly) recoverable error has occurred.
FATAL
a fatal (abortive) error has occurred.


getStatusText

String getStatusText(int status)
Returns a localized String indicating the provided message status. E.g., "ERROR:", "WARNING:", etc. For non-warning and error messages requests this should return an empty String (not null).

This is a MessageHandler API method.