|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.util.MessageHandlerImpl
public class MessageHandlerImpl
Implements MessageHandler, a messaging API. This class
receives messaging events, also implementing and extending the SAX ErrorHandler
interface. This also incorporates an application idle checker, which returns true
on isIdle() following the delay set by the idle handler. It is the
occurrence of message events or a call to active() that delays going
into an idle state.
There are seven types of message handling, with resulting action based on which method is called:
| method type | state | description |
|---|---|---|
| localize | normal | 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. |
Note that status messages do not change the MessageHandler status.
The first parameter id may be a MessageId or MsgId reference from
either of the localized ListResourceBundles Msg or
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 )
public String message( String id, String arg1, String arg2, String arg3, String arg4 )
localize() is also available with as many as six parameters.
Almost all return the resultant localized String, though in most cases (except for localize()) in Ceryle this is not used. warning, error and fatalError write output to stderr or to a designated File errorfile.
Previous versions of Ceryle used its own Logger
class for logging, which worked fine, but the ready availability of Log4J
as part of the pool of included libraries made it seem almost silly not to
use it, so in recent versions log messages are now sent to Log4J, whose
configuration file is in $CERYLE_HOME/resource/log4j.properties.
Here's the useful Log4J methods in Level order:
// Log4J printing methods: public void debug( Object message ); public void info( Object message ); public void warn( Object message ); public void error( Object message ); public void fatal( Object message );Log4J will already be configured and running prior to the MessageHandler starting. (is this a good thing? does it really matter?)
The static localize() methods found in the Localizer
class uses the org.ceryle.util.Msg ResourceBundle, which is considered a
"core" set of messages, used by XML and XNode services.
The Utilities class uses the org.ceryle.util.Msg,
and org.ceryle.util.Message ResourceBundles, checking the incoming message
ID and then using the appropriate ResourceBundle. This is done by using a cheap
trick: all message IDs in the MsgId class begin with an underscore character.
MessageHandler,
Localizer| Field Summary | |
|---|---|
static String |
CERYLE_LOG_FILE
The default filename for the Ceryle log file. |
protected int |
errors
Count of errors received by this MessageHandler. |
protected static String |
m_logFilename
The log filename. |
protected int |
maxErrors
Maximum error count before exit (abort). |
protected int |
maxWarnings
Maximum warning count before exit (abort). |
static boolean |
permitExit
When true, permits the MessageHandler to force an application exit upon a fatal error. |
protected int |
warnings
Count of warnings received by this MessageHandler. |
| Fields inherited from interface org.ceryle.util.MessageHandler |
|---|
DEBUG, ERROR, FATAL, INFO, LOCALIZE, LOG, LOG_FEATURE_PFX, LOG_LEVEL, MESSAGE_VERBOSE, MSG_PROPERTY_PFX, NOTICE, OFF, OK, WARN |
| Constructor Summary | |
|---|---|
MessageHandlerImpl()
Default constructor; initializes the idle handler and all warning and error counters using default values. |
|
MessageHandlerImpl(Properties properties)
Constructor with Properties properties. |
|
MessageHandlerImpl(Properties properties,
SafeQuit safequit)
Constructor with an optional Properties properties and an optional implementer of the SafeQuit API. |
|
| Method Summary | |
|---|---|
void |
active()
Indicates any kind of application activity, called upon any kind of system message sent to the MessageHandler (except requests for localization). |
void |
closeErrorFile()
Closes the error file filename, if open. |
String |
error(Exception exception)
Tunnel an existing Exception. |
void |
error(SAXParseException exception)
Tunnel an existing SAXParseException. |
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. |
void |
exit(int status,
String exitMessage,
Exception exception)
Aborts all processes and terminates the currently running application. |
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. |
void |
fatalError(SAXParseException exception)
A method which handles a fatal exception given a tunneled SAXParseException. |
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. |
void |
flush()
Flushes the error file if open. |
Clock |
getClock()
Returns the Clock object used by this MessageHandler for generating timestamps. |
static Properties |
getDefaultProperties()
Return the default Properties for the MessageHandler. |
long |
getElapsed(boolean active,
boolean millis)
Returns a long indicating the amount of time passed since the application session began. |
int |
getErrorCount()
Returns the current number of errors registered with this MessageHandler. |
Enumeration |
getErrorList()
Returns an Enumeration of the current error list. |
Idler |
getIdler()
Returns the Idler object used by this MessageHandler for keeping track of idle state. |
static org.apache.log4j.Level |
getLogLevel(int state)
Converts the provided MessageHandler state value to a Log4J Level. |
Properties |
getProperties()
Return the current MessageHandler Properties. |
int |
getSignalThreshold()
Return the current signal threshold setting. |
int |
getStatus()
Return the current MessageHandler status: OK no activity LOG a log message has occurred. |
String |
getStatusText(int status)
Returns a localized String indicating the provided message status. |
int |
getWarningCount()
Returns the current number of warnings registered with this MessageHandler. |
Enumeration |
getWarningList()
Returns an Enumeration of the current warning list. |
Writer |
getWriter()
Returns the Writer used by for this MessageHandler. |
boolean |
isIdle()
Returns the current idle state. |
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 |
openErrorFile(String filename)
Opens error file filename for writing, defining the Writer writer. |
void |
printStackTrace(Throwable throwable)
Prints the stack trace from the provided Exception to the error output. |
void |
registerListener(MessageWriter msgwriter)
Registers the provided object wi as the receiver for MessageHandler messaging events. |
void |
registerProcessor(Object processor)
Registers the provided Object processor with this MessageHandler, so that in the event of a fatal error this might be set to null. |
void |
reset()
Clears all warning and error counters and containers. |
void |
setMaxErrors(int newMax)
Sets the maximum error count before exit (abort). |
void |
setMaxWarnings(int newMax)
Sets the maximum warning count before exit (abort). |
void |
setProperties(Properties properties)
Set MessageHandler properties to the provided Properties. |
void |
setSafeQuit(SafeQuit safequit)
Sets the recipient for safe quit confirmation and quit messages. |
void |
setSignalThreshold(int status)
Set signalling to the int value 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. |
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. |
void |
warning(SAXParseException exception)
Tunnel an existing SAXParseException. |
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 status 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean permitExit
public static final String CERYLE_LOG_FILE
protected static String m_logFilename
protected int errors
protected int maxErrors
protected int warnings
protected int maxWarnings
| Constructor Detail |
|---|
public MessageHandlerImpl()
public MessageHandlerImpl(Properties properties)
public MessageHandlerImpl(Properties properties,
SafeQuit safequit)
SafeQuit API.
Initializes the idle handler and all warning and error counters.
If the Properties parameter is null, properties can be later set
using setProperties(Properties).
| Method Detail |
|---|
public static Properties getDefaultProperties()
MessageHandler.LOG_LEVEL property.
public void setProperties(Properties properties)
public Properties getProperties()
public void setSafeQuit(SafeQuit safequit)
public Clock getClock()
This is a MessageHandler API method.
getClock in interface MessageHandlerpublic Idler getIdler()
public Writer getWriter()
getWriter in interface MessageHandlerpublic void registerProcessor(Object processor)
public void registerListener(MessageWriter msgwriter)
This is a MessageHandler API method.
registerListener in interface MessageHandlerpublic void writeStatus(String message)
This is both a MessageWriter and MessageHandler API method.
writeStatus in interface MessageHandlerwriteStatus in interface MessageWriterpublic void writeMessage(String message)
This is both a MessageWriter and MessageHandler API method.
writeMessage in interface MessageHandlerwriteMessage in interface MessageWriter
public String writeMessage(int status,
String message)
MessageHandler.
This is both a MessageWriter and MessageHandler API method.
writeMessage in interface MessageHandlerwriteMessage in interface MessageWriterMessageHandlerpublic void active()
active in interface MessageHandlerpublic void setSignalThreshold(int status)
This is the level of message (i.e., MessageHandler status) that
must be met to become an 'active' signal, indicated to the Idler
as system activity. For example, setting the level to
MessageHandler.WARN would require a warning or error
message to be considered a signal.
Acceptable values are:
MessageHandler.DEBUG, MessageHandler.LOG,
MessageHandler.INFO, MessageHandler.NOTICE,
MessageHandler.WARN, or MessageHandler.ERROR.
Invalid values are ignored.
public int getSignalThreshold()
public boolean isIdle()
public long getElapsed(boolean active,
boolean millis)
If logging is not active, this always returns 0.
public void printStackTrace(Throwable throwable)
printStackTrace in interface MessageHandlerpublic String localize(String id)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String localize(String id,
String arg1)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String localize(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String localize(String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String localize(String id,
String arg1,
String arg2,
String arg3,
String arg4)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public String localize(String id,
String arg1,
String arg2,
String arg3,
String arg4,
String arg5)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public String localize(String id,
String arg1,
String arg2,
String arg3,
String arg4,
String arg5,
String arg6)
This is a MessageHandler API method.
localize in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public String log(String message)
This is a MessageHandler API method.
log in interface MessageHandlermessage - the message to be written to the log file.
public String log(String timeStamp,
String id)
This is a MessageHandler API method.
log in interface MessageHandlertimeStamp - the optional time stamp string to be added to the log.id - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String log(String timeStamp,
String id,
String arg1)
This is a MessageHandler API method.
log in interface MessageHandlertimeStamp - the optional time stamp string to be added to the log.id - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String log(String timeStamp,
String id,
String arg1,
String arg2)
This is a MessageHandler API method.
log in interface MessageHandlertimeStamp - the optional time stamp string to be added to the log.id - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String log(String timeStamp,
String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
log in interface MessageHandlertimeStamp - the optional time stamp string to be added to the log.id - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String log(String timeStamp,
String id,
String arg1,
String arg2,
String arg3,
String arg4)
This is a MessageHandler API method.
log in interface MessageHandlertimeStamp - the optional time stamp string to be added to the log.id - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public void status(String id)
This is a MessageHandler API method.
status in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public void status(String id,
String arg1)
This is a MessageHandler API method.
status in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public void status(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
status in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public void status(String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
status in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public void status(String id,
String arg1,
String arg2,
String arg3,
String arg4)
This is a MessageHandler API method.
status in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.public String message(String id)
This is a MessageHandler API method.
message in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String message(String id,
String arg1)
This is a MessageHandler API method.
message in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String message(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
message in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String message(String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
message in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String message(String id,
String arg1,
String arg2,
String arg3,
String arg4)
This is a MessageHandler API method.
message in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public String notice(String id)
This is a MessageHandler API method.
notice in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String notice(String id,
String arg1)
This is a MessageHandler API method.
notice in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String notice(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
notice in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String notice(String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
notice in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String notice(String id,
String arg1,
String arg2,
String arg3,
String arg4)
This is a MessageHandler API method.
notice in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.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.
public String warning(String id)
This is a MessageHandler API method.
warning in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String warning(Exception exception)
This is a MessageHandler API method.
warning in interface MessageHandlerexception - the tunneled Exception.
public void warning(SAXParseException exception)
warning in interface ErrorHandlerexception - the tunneled SAXParseException.
public String warning(String id,
String arg1)
This is a MessageHandler API method.
warning in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String warning(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
warning in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String warning(String id,
String arg1,
String arg2,
String arg3)
This is a MessageHandler API method.
warning in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String error(String id)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String error(Exception exception)
This is a MessageHandler API method.
error in interface MessageHandlerexception - the tunneled Exception.
public void error(SAXParseException exception)
error in interface ErrorHandlerexception - the tunneled SAXParseException.
public String error(String id,
Exception exception)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.exception - the tunneled Exception.
public String error(String id,
String arg)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg - argument substituting %1 in the message string.
public String error(String id,
String arg,
Exception exception)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg - argument substituting %1 in the message string.exception - the tunneled Exception.
public String error(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String error(String id,
String arg1,
String arg2,
String arg3)
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.arg3 - argument substituting %3 in the message string.
public String error(String id,
String arg1,
String arg2,
Exception exception)
This is a MessageHandler API method.
error in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.exception - the tunneled Exception.
public String fatalError(Exception exception)
This is a MessageHandler API method.
fatalError in interface MessageHandlerexception - the tunneled Exception.
public void fatalError(SAXParseException exception)
fatalError in interface ErrorHandlerexception - the tunneled SAXParseException.public String fatalError(Error error)
fatalError in interface MessageHandlererror - the Error thrown.
public String fatalError(String id)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.
public String fatalError(String id,
Exception exception)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.exception - the tunneled Exception.
public String fatalError(String id,
String arg1)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.
public String fatalError(String id,
String arg1,
Exception exception)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.exception - the tunneled Exception.
public String fatalError(String id,
String arg1,
String arg2)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.
public String fatalError(String id,
String arg1,
String arg2,
Exception exception)
This is a MessageHandler API method.
fatalError in interface MessageHandlerid - the MsgId or MessageId within the ListResourceBundle
MsgId or MessageId, respectively.arg1 - argument substituting %1 in the message string.arg2 - argument substituting %2 in the message string.exception - the tunneled Exception.
public Enumeration getWarningList()
public Enumeration getErrorList()
public int getWarningCount()
public int getErrorCount()
public void setMaxWarnings(int newMax)
public void setMaxErrors(int newMax)
public String getStatusText(int status)
This is a MessageHandler API method.
getStatusText in interface MessageHandlerpublic int getStatus()
Note that the constants used for status are integers and can be compared using less-than and greater than operators.
getStatus in interface MessageHandlerpublic static org.apache.log4j.Level getLogLevel(int state)
| state | returns... | OK | Level.ALL (i.e., all messages) | LOCALIZE | default | DEBUG | Level.DEBUG | LOG | default | INFO | Level.INFO | NOTICE | default | WARN | Level.WARN | ERROR | Level.ERROR | FATAL | Level.FATAL | OFF | Level.OFF (i.e., logging off) |
|---|
public void reset()
reset in interface MessageHandler
public void exit(int status,
String exitMessage,
Exception exception)
status - indicates an error condition when true.exitMessage - final exit messageexception - the tunneled exception, used to print a stack tracepublic void openErrorFile(String filename)
public void flush()
throws IOException
IOExceptionpublic void closeErrorFile()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||