Oracle Data-aware Controls Reference

Package oracle.dacf.util.errormanager

The ErrorManager is a singleton object that manages the storage and flow of ErrorMessage objects, and administers the registration of error listeners and error loggers.

See:
          Description

Interface Summary
ErrorAttribute The ErrorAttribute interface defines an error attribute to be recorded in the logging facilities.
ErrorLogger The ErrorLogger interface implements the base methods for an ErrorLogger implementation.
ErrorManagerListener Defines the interface for ErrorManager event listeners.
ErrorMessageContext The ErrorMessageContext interface represents the situation- or error-specific context information attached to the ErrorMessage.
 

Class Summary
ErrorLoggerAdapter The ErrorLoggerAdapter interface is the Adapter implementation for the error logger, and defines an abstract non-buffered logger.
ErrorManager The ErrorManager is a singleton object that manages the storage and flow of ErrorMessage objects.
ErrorMessage The ErrorMessage class is an overloaded class and is used to define an error.
ErrorMessageText The ErrorMessageText class is an overloaded class that defines the error message as a message text and a message ID.
ErrorSeverity The ErrorSeverity class definines the text to be used for a given error severity.
ErrorTimeStamp The ErrorTimeStamp class defines the time stamp given to an error message when it is logged.
ErrorType The ErrorType class provides the base methods for defining error types or categories.
SimpleErrorAttributeImpl The SimpleErrorAttributeImpl class is the simplest implementation of the ErrorAttribute interface.
 

Exception Summary
AddErrorException An ErrorLogger can throw this runtime exception when adding an error to its log.
ErrorMessageVetoException The ErrorMessageVetoException is thrown by error listeners when they want to veto either the:
NameAlreadyRegisteredException The ErrorManager throws a NameAlreadyRegisteredException when an attempt is made to register an ErrorListener or ErrorLogger with a name that has already been used for registration.
 

Package oracle.dacf.util.errormanager Description

The ErrorManager is a singleton object that manages the storage and flow of ErrorMessage objects, and administers the registration of error listeners and error loggers.

The ErrorManager is invoked when:

The ErrorManager notifies all registered error listeners when an error is added or removed. To be elegible for notification, the error listener must be registered. Each of these error listeners can veto the adding or the removing of the error. This vetoing will rollback the error and the error will not be recorded in the error loggers. If the error is not vetoed, it will be recorded in the error loggers. There are two types of error loggers:

Listeners

Listeners implement the ErrorListener interface and provide a mechanism to handle error situations. When adding or removing an error from the stack, the ErrorManager notifies all registered error listeners by calling addingErrorMessage(ErrorMessage) or removingErrorMessage(ErrorMessage) respectively. Both methods can call an ErrorMessageVetoException which will rollback the error. As a result:

Buffered Loggers

Buffered loggers keep an error stack with all of their context-specific and context-less information. They can be used by listeners to make recover or ignore error descisions. Buffered loggers can also be used to write a interactive tool to look at the error stack and try to recover manually.

Non-buffered Loggers

Non-buffered loggers use only error information which is not context-specific (see oracle.dacf.util.errormanager.ErrorMessage). Non-buffered loggers deal with errors as a collection of Strings (see oracle.dacf.util.errormanager.ErrorAttribute). These loggers do not store errors. Instead, they write errors to printers, an output window, log files, and so on.

What is an Error?

An error is represented by the ErrorMessage class. An ErrorMessage can either be:

The default ErrorMessage class is without context (except for the source object). This is the generic ErrorMessage and defines these attributes:

The source object is used by listeners to throw exceptions and possibly by non-buffered loggers to interact between the user and the error stack.

The ErrorType, ErrorSeverity, ErrorMessageText attributes implement ErrorAttribute and Enumeration. The ErrorTimeStamp attribute is constructed by the class constructor. These attributes are context-less and can be used for indication, status checking, and so on.

The context-specific version of the ErrorMessage class contains these context-less attributes but also includes a Context attribute. The Context attribute allows you to define your own error messages by extending the ErrorMessage class and adding error-specific information.

To extend ErrorMessage, you must write an ErrorMessageContext class. This class holds all the information used by error listeners to make veto descisions, or in the case of DACF controls, the information used by the NavigationManager. The ErrorMessageContext class can provide some of its context as context-less information in the form of error attributes.

For an example of a context-specific ErrorMessage class, see the oracle.dacf.dataset.dacfErrorMessageContext class. It adds DacfContext (dataItem, row, control, related errors) to ErrorMessage and provides a Context-description of all fields it wants to log to non-buffered loggers.

The attributes ErrorType, ErrorSeverity, ErrorMessageText implement:

ErrorAttribute

The ErrorAttribute class implements the context-specific information. It defines every error component as a label and a description (getLabel()/toString()) and allows any dynamic UI to represent every error component with the proper label.

Enumeration

It is normal practice in Java programming to use integers or strings as flags. This is not real enumeration, because you are offering a variable name and internally dealing with its value. Any conflict of using the same integer with another name can cause unexpected behavior. Sloppy code, where developers enter an integer value instead of the flag name is not recognized by the compiler.

To avoid these conflicts, a special type of enumeration has been implemented. A developer wanting to extend the definitions of ErrorType, ErrorSeverity, or ErrorMessageText must subclass and provide either enumerated variables or a Factory class. For examples of this type of enumeration, see oracle.dacf.dataset.DacfSeverity, oracle.dacf.dataset.DacfType, and oracle.dacf.util.errormanager.ErrorMessageText.

NOTE:

One ErrorLogger is registered by default: this is the DACFErrorPopupLogger that pops up errors in DAC applications. If you do not want this behavior, or if you want to replace the pop-up errors with your own ErrorLogger, you must remove the registered Logger. You remove the logger with the following statement:

          import oracle.dacf.util.errorloggers.DacfErrorPopupLogger;
          ..........
          ..........
          ErrorManager.removeErrorLogger(DacfErrorPopupLogger.NAME);

See Also:
DacfSeverity, DacfType, DacfErrorPopupLogger, ErrorMessageText, ErrorType, ErrorSeverity, ErrorMessage

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.