org.sape.carbon.core.util.classify
Class SeverityEnum

java.lang.Object
  |
  +--org.sape.carbon.core.util.enum.BaseEnum
        |
        +--org.sape.carbon.core.util.classify.SeverityEnum
All Implemented Interfaces:
Serializable

public class SeverityEnum
extends BaseEnum

This generic severity classification system is used by the Core Carbon to classify Exceptions and logging messages. This standardized system will allow for consistent handling of these events throughout the Core Carbon.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.12 $($Author: dvoet $ / $Date: 2003/05/05 21:21:22 $)
Author:
Greg Hinkle, January 2002
See Also:
Serialized Form

Nested Class Summary
 class SeverityEnum.SeverityEnumNotFoundException
          This class is a typesafe retriever excepection for an enumeration
 
Nested classes inherited from class org.sape.carbon.core.util.enum.BaseEnum
 
Field Summary
static SeverityEnum DEBUG
          Severity to be used for moderately detailed information needed to debug system problems.
static int DEBUG_ORDINAL
           
static SeverityEnum ERROR
          Severity to be used when the system encountered an error which it could not handle and was forced to terminate the current operation, but concurrent and future requests should not be affected.
static int ERROR_ORDINAL
           
static SeverityEnum FATAL
          Should be used when the system encounters a critical error which affects the accuracy, integrity or capability of the system as a whole, not just the current request/transaction.
static int FATAL_ORDINAL
           
static SeverityEnum INFO
          Severity to be used for all interesting periodic events so that anyone browsing the logs should be able to see the amount and kind of processing occurring in the system
static int INFO_ORDINAL
           
static SeverityEnum TRACE
          Severity to be used for high verbosity debug logging that could significantly affect the performance of the system.
static int TRACE_ORDINAL
           
static SeverityEnum WARN
          Severity to be used when the system encountered a recoverable error, which should non-the-less be logged as its occurrence is significant.
static int WARN_ORDINAL
           
 
Fields inherited from class org.sape.carbon.core.util.enum.BaseEnum
name, ordinal
 
Constructor Summary
private SeverityEnum(String name, int ordinal)
          Constructs a enumeration of type SeverityEnum
 
Method Summary
static SeverityEnum getByName(String name)
          Looks up a SeverityEnum by its string representation
static SeverityEnum getByOrdinal(int ordinal)
          Looks up a SeverityEnum by its ordinal representation
static Iterator iterator()
          Creates an iterator over the values of the enumerated type
(package private)  Object readResolve()
          Overrides part of serialization to return a reference to an enumeration instance that is managed by the Enumeration Subsystem.
 
Methods inherited from class org.sape.carbon.core.util.enum.BaseEnum
equals, getByName, getByOrdinal, getName, getOrdinal, hashCode, iterator, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FATAL_ORDINAL

public static final int FATAL_ORDINAL
Since:
carbon 2.0
See Also:
FATAL, Constant Field Values

FATAL

public static final SeverityEnum FATAL
Should be used when the system encounters a critical error which affects the accuracy, integrity or capability of the system as a whole, not just the current request/transaction.


ERROR_ORDINAL

public static final int ERROR_ORDINAL
Since:
carbon 2.0
See Also:
ERROR, Constant Field Values

ERROR

public static final SeverityEnum ERROR
Severity to be used when the system encountered an error which it could not handle and was forced to terminate the current operation, but concurrent and future requests should not be affected.


WARN_ORDINAL

public static final int WARN_ORDINAL
Since:
carbon 2.0
See Also:
WARN, Constant Field Values

WARN

public static final SeverityEnum WARN
Severity to be used when the system encountered a recoverable error, which should non-the-less be logged as its occurrence is significant.


DEBUG_ORDINAL

public static final int DEBUG_ORDINAL
Since:
carbon 2.0
See Also:
DEBUG, Constant Field Values

DEBUG

public static final SeverityEnum DEBUG
Severity to be used for moderately detailed information needed to debug system problems.


INFO_ORDINAL

public static final int INFO_ORDINAL
Since:
carbon 2.0
See Also:
INFO, Constant Field Values

INFO

public static final SeverityEnum INFO
Severity to be used for all interesting periodic events so that anyone browsing the logs should be able to see the amount and kind of processing occurring in the system


TRACE_ORDINAL

public static final int TRACE_ORDINAL
Since:
carbon 2.0
See Also:
TRACE, Constant Field Values

TRACE

public static final SeverityEnum TRACE
Severity to be used for high verbosity debug logging that could significantly affect the performance of the system.

Constructor Detail

SeverityEnum

private SeverityEnum(String name,
                     int ordinal)
Constructs a enumeration of type SeverityEnum

Parameters:
name - the name of the severity level to build
Method Detail

getByName

public static final SeverityEnum getByName(String name)
Looks up a SeverityEnum by its string representation

Parameters:
name - the String name of a enumeration instance
Returns:
a specific SeverityEnum

getByOrdinal

public static SeverityEnum getByOrdinal(int ordinal)
Looks up a SeverityEnum by its ordinal representation

Parameters:
ordinal - the integer ordinal value of a specific enumeration instance
Returns:
a specific SeverityEnum

iterator

public static Iterator iterator()
Creates an iterator over the values of the enumerated type

Returns:
an iterator over the values of this enumerated type

readResolve

final Object readResolve()
                  throws ObjectStreamException
Overrides part of serialization to return a reference to an enumeration instance that is managed by the Enumeration Subsystem. This will always return the SAME object instance for any single enum instance and is what allows the "==" operator to be used for comparisons.

Returns:
the object instance that should be resolved by this class
Throws:
ObjectStreamException - when there is a failure to resolve the streamed object due to a format or read io exception


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.