atg.nucleus.logging
Class VariableArgumentApplicationLoggingUtil

java.lang.Object
  extended by atg.common.util.PropertyFormatter
      extended by atg.nucleus.logging.VariableArgumentApplicationLoggingUtil

public class VariableArgumentApplicationLoggingUtil
extends atg.common.util.PropertyFormatter

Implementation class for variable argument logging utility methods. Implemented as an instance class for subclassing and overriding purposes.

All methods use MessageFormat style argument strings. The MessageFormat interpretation used by this class has been extended to understand DynamicBeans property syntax DynamicBeans. The syntax supported is that handled by DynamicBeans.getSubPropertyValue(java.lang.Object, java.lang.String). For example, "{0.absoluteName}" or "{0.addresses[0].city}".

Created: August 19 2008


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.common.util.PropertyFormatter
atg.common.util.PropertyFormatter.NumberIndexDictionary
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String INSTANCE_CLASS_PROPERTY_NAME
           
static VariableArgumentApplicationLoggingUtil sInstance
           
static java.lang.String TRACE_PREFIX
          Prefix for trace messages when logging through a non-TraceApplicationLogging
 
Constructor Summary
VariableArgumentApplicationLoggingUtil()
           
 
Method Summary
protected  java.lang.String getBundleString(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Get the specified String from the bundle using the specified key.
static VariableArgumentApplicationLoggingUtil getInstance()
          Return an instance of this class for use by other implementations.
protected  java.lang.String getTracePrefix()
          Prefix to use when logging trace messages through a non-TraceApplicationLogging logger.
protected  java.lang.Throwable getUnreferencedThrowable(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Return the unreferenced throwable, if it is the last argument.
 void vlogDebug(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log debug message through pLogging.
 void vlogDebug(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted debug message through pLogging.
 void vlogDebug(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log debug message through pLogging.
 void vlogDebug(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted debug message through pLogging.
 void vlogError(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log error message through pLogging.
 void vlogError(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted error message through pLogging.
 void vlogError(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log error message through pLogging.
 void vlogError(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted error message through pLogging.
 void vlogInfo(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log info message through pLogging.
 void vlogInfo(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted info message through pLogging.
 void vlogInfo(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log info message through pLogging.
 void vlogInfo(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted info message through pLogging.
 void vlogTrace(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log trace message through pLogging.
 void vlogTrace(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted trace message through pLogging.
 void vlogTrace(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log trace message through pLogging.
 void vlogTrace(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted trace message through pLogging.
 void vlogWarning(ApplicationLogging pLogging, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log warning message through pLogging.
 void vlogWarning(ApplicationLogging pLogging, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted warning message through pLogging.
 void vlogWarning(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.util.ResourceBundle pBundle, java.lang.String pKey, java.lang.Object[] pArgs)
          Log a resource-based log warning message through pLogging.
 void vlogWarning(ApplicationLogging pLogging, java.lang.Throwable pThrowable, java.lang.String pFormat, java.lang.Object[] pArgs)
          Log a formatted warning message through pLogging.
 
Methods inherited from class atg.common.util.PropertyFormatter
createArgBeanPropertyPattern, createArgPresentPattern, createArgPresentPatterns, createArgPresentPatterns, findPropertiedArgClose, format, getArgBeanPropertyPattern, getArgPresentPattern, getArgPresentPatterns, hasArgBeanProperty, messageFormat, replaceArgsForImprovedPrinting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


sInstance

public static volatile VariableArgumentApplicationLoggingUtil sInstance

INSTANCE_CLASS_PROPERTY_NAME

public static final java.lang.String INSTANCE_CLASS_PROPERTY_NAME
See Also:
Constant Field Values

TRACE_PREFIX

public static final java.lang.String TRACE_PREFIX
Prefix for trace messages when logging through a non-TraceApplicationLogging

See Also:
Constant Field Values
Constructor Detail

VariableArgumentApplicationLoggingUtil

public VariableArgumentApplicationLoggingUtil()
Method Detail

getInstance

public static VariableArgumentApplicationLoggingUtil getInstance()
Return an instance of this class for use by other implementations.


vlogDebug

public void vlogDebug(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log debug message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing debug logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogDebug

public void vlogDebug(ApplicationLogging pLogging,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log debug message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing debug logging, then just return.

Parameters:
pLogging - The application logging to log through.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogDebug

public void vlogDebug(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted debug message through pLogging. If not currently doing debug logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogDebug

public void vlogDebug(ApplicationLogging pLogging,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted debug message through pLogging. If not currently doing debug logging, then just return.

Parameters:
pLogging - The application logging to log through.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogError

public void vlogError(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log error message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing error logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogError

public void vlogError(ApplicationLogging pLogging,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log error message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing error logging, then just return.

Parameters:
pLogging - The application logging to log through.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogError

public void vlogError(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted error message through pLogging. If not currently doing error logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogError

public void vlogError(ApplicationLogging pLogging,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted error message through pLogging. If not currently doing error logging, then just return.

Parameters:
pLogging - The application logging to log through.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogWarning

public void vlogWarning(ApplicationLogging pLogging,
                        java.lang.Throwable pThrowable,
                        java.util.ResourceBundle pBundle,
                        java.lang.String pKey,
                        java.lang.Object[] pArgs)
Log a resource-based log warning message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing warning logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogWarning

public void vlogWarning(ApplicationLogging pLogging,
                        java.util.ResourceBundle pBundle,
                        java.lang.String pKey,
                        java.lang.Object[] pArgs)
Log a resource-based log warning message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing warning logging, then just return.

Parameters:
pLogging - The application logging to log through.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogWarning

public void vlogWarning(ApplicationLogging pLogging,
                        java.lang.Throwable pThrowable,
                        java.lang.String pFormat,
                        java.lang.Object[] pArgs)
Log a formatted warning message through pLogging. If not currently doing warning logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogWarning

public void vlogWarning(ApplicationLogging pLogging,
                        java.lang.String pFormat,
                        java.lang.Object[] pArgs)
Log a formatted warning message through pLogging. If not currently doing warning logging, then just return.

Parameters:
pLogging - The application logging to log through.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogInfo

public void vlogInfo(ApplicationLogging pLogging,
                     java.lang.Throwable pThrowable,
                     java.util.ResourceBundle pBundle,
                     java.lang.String pKey,
                     java.lang.Object[] pArgs)
Log a resource-based log info message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing info logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogInfo

public void vlogInfo(ApplicationLogging pLogging,
                     java.util.ResourceBundle pBundle,
                     java.lang.String pKey,
                     java.lang.Object[] pArgs)
Log a resource-based log info message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing info logging, then just return.

Parameters:
pLogging - The application logging to log through.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogInfo

public void vlogInfo(ApplicationLogging pLogging,
                     java.lang.Throwable pThrowable,
                     java.lang.String pFormat,
                     java.lang.Object[] pArgs)
Log a formatted info message through pLogging. If not currently doing info logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogInfo

public void vlogInfo(ApplicationLogging pLogging,
                     java.lang.String pFormat,
                     java.lang.Object[] pArgs)
Log a formatted info message through pLogging. If not currently doing info logging, then just return.

Parameters:
pLogging - The application logging to log through.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogTrace

public void vlogTrace(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log trace message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing trace logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogTrace

public void vlogTrace(ApplicationLogging pLogging,
                      java.util.ResourceBundle pBundle,
                      java.lang.String pKey,
                      java.lang.Object[] pArgs)
Log a resource-based log trace message through pLogging. The key should refer to a resource containing a format string to use. If not currently doing trace logging, then just return.

Parameters:
pLogging - The application logging to log through.
pBundle - The resoure bundle.
pKey - the resource key in the bundle to use as a format string.
pArgs - the format arguments needed by the key's format string.

vlogTrace

public void vlogTrace(ApplicationLogging pLogging,
                      java.lang.Throwable pThrowable,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted trace message through pLogging. If not currently doing trace logging, then just return.

Parameters:
pLogging - The application logging to log through.
pThrowable - the exception to be logged. Will be logged after the message.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

vlogTrace

public void vlogTrace(ApplicationLogging pLogging,
                      java.lang.String pFormat,
                      java.lang.Object[] pArgs)
Log a formatted trace message through pLogging. If not currently doing trace logging, then just return.

Parameters:
pLogging - The application logging to log through.
pFormat - The format string to use. Uses MessageFormat to render.
pArgs - the format arguments needed by the key's format string.

getBundleString

protected java.lang.String getBundleString(ApplicationLogging pLogging,
                                           java.util.ResourceBundle pBundle,
                                           java.lang.String pKey,
                                           java.lang.Object[] pArgs)
Get the specified String from the bundle using the specified key. Attempts to log on any problems, so poor user might be able get a clue.

Parameters:
pLogging - the application logging to use.
pBundle - the resource bundle to obtain the resource from.
pKey - the key to look up in the resource bundle.
pArgs - the format arguments.

getTracePrefix

protected java.lang.String getTracePrefix()
Prefix to use when logging trace messages through a non-TraceApplicationLogging logger. Message goes through debug, instead.


getUnreferencedThrowable

protected java.lang.Throwable getUnreferencedThrowable(ApplicationLogging pLogging,
                                                       java.lang.String pFormat,
                                                       java.lang.Object[] pArgs)
Return the unreferenced throwable, if it is the last argument. Will also log a warning.

Parameters:
pLogging - the logging to use for a warning, if an unreferenced throwable is found to be the last argument.
pFormat - the format string.
-