com.netscape.certsrv.logging
Class ELogException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.netscape.certsrv.base.EBaseException
              extended by com.netscape.certsrv.logging.ELogException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ELogNotFound, ELogPluginNotFound

public class ELogException
extends EBaseException

This class implements a Log exception. LogExceptions should be caught by LogSubsystem managers.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
MessageFormat, Serialized Form

Field Summary
 
Fields inherited from class com.netscape.certsrv.base.EBaseException
mParams
 
Constructor Summary
ELogException(java.lang.String msgFormat)
          Constructs a log exception.
ELogException(java.lang.String msgFormat, java.lang.Exception param)
          Constructs a log exception.
ELogException(java.lang.String msgFormat, java.lang.Object[] params)
          Constructs a log exception with a list of parameters that will be substituted into the message format.
ELogException(java.lang.String msgFormat, java.lang.String param)
          Constructs a log exception with a parameter.
 
Method Summary
protected  java.lang.String getBundleName()
          Retrieves resource bundle name.
 java.lang.Object[] getParameters()
          Returns a list of parameters.
 java.lang.String toString()
          Returns localized exception string.
 java.lang.String toString(java.util.Locale locale)
          Returns the string based on the given locale.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ELogException

public ELogException(java.lang.String msgFormat)
Constructs a log exception.

Parameters:
msgFormat - Exception details.

ELogException

public ELogException(java.lang.String msgFormat,
                     java.lang.String param)
Constructs a log exception with a parameter. For example,
                new ELogException("failed to load {0}", fileName);
 

Parameters:
msgFormat - Exception details in message string format.
param - Message string parameter.

ELogException

public ELogException(java.lang.String msgFormat,
                     java.lang.Exception param)
Constructs a log exception. It can be used to carry a system exception that may contain information about the context. For example,
                try {
                ...
                } catch (IOExeption e) {
                        throw new ELogException("Encountered System Error {0}", e);
      }
 

Parameters:
msgFormat - Exception details in message string format.
param - System exception.

ELogException

public ELogException(java.lang.String msgFormat,
                     java.lang.Object[] params)
Constructs a log exception with a list of parameters that will be substituted into the message format.

Parameters:
msgFormat - Exception details in message string format.
params - List of message format parameters.
Method Detail

getParameters

public java.lang.Object[] getParameters()
Returns a list of parameters.

Overrides:
getParameters in class EBaseException
Returns:
list of message format parameters.

toString

public java.lang.String toString()
Returns localized exception string. This method should only be called if a localized string is necessary.

Overrides:
toString in class EBaseException
Returns:
Details message.

toString

public java.lang.String toString(java.util.Locale locale)
Returns the string based on the given locale.

Overrides:
toString in class EBaseException
Parameters:
locale - Locale.
Returns:
Details message.

getBundleName

protected java.lang.String getBundleName()
Retrieves resource bundle name. Subclasses should override this as necessary

Overrides:
getBundleName in class EBaseException
Returns:
String containing name of resource bundle.