Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::LogParameterUtil Class Reference

List of all members.

Public Member Functions

 LogParameterUtil (LogRecord currentLogRecord)
void setCurrentLogRecord (LogRecord logRecord)
List< Object > getNonSpecialPropertiesMapParameters ()
long extractLongProperty (String name, long defaultValue)
String extractStringProperty (String name, String defaultValue)

Static Public Member Functions

Map< String, Object > createPropertiesMap ()

Static Public Attributes

final String IS_ACS_PROPERTIES_MAP_KEYNAME = "isAcsPropertiesMap"
final String PARAM_THREAD_NAME = "ThreadName"
final String PARAM_LINE = "Line"
final String PARAM_HOSTNAME = "HostName"
final String PARAM_STACK_ID = "StackId"
final String PARAM_STACK_LEVEL = "StackLevel"
final String PARAM_PRIORITY = "Priority"
final String PARAM_URI = "Uri"
final String PARAM_PROCESSNAME = "ProcessName"
final String PARAM_SOURCEOBJECT = "SourceObject"

Package Functions

Map< String, Object > extractSpecialPropertiesMap ()

Private Attributes

LogRecord currentLogRecord
Map< String, Object > specialProperties
List< Object > otherParameters

Detailed Description

Class that encapsulates access to log record parameters, and handling of a special Property-Map parameter. Some conventions are necessary because we "smuggle" some extra information from the plain-JDK loggers to the ACS-aware log dispatcher. The alternative would be to expose ACS custom loggers to applications, which seems too ugly for the benefit it provides.

The rules are:

Note that this class is stateful: returned values come from the last given LogRecord, which can be set in the constructor or overwritten in setCurrentLogRecord(LogRecord).


Constructor & Destructor Documentation

alma::acs::logging::LogParameterUtil::LogParameterUtil LogRecord  currentLogRecord  )  [inline]
 


Member Function Documentation

Map<String, Object> alma::acs::logging::LogParameterUtil::createPropertiesMap  )  [inline, static]
 

Creates a new special properties map.

Returns:

long alma::acs::logging::LogParameterUtil::extractLongProperty String  name,
long  defaultValue
[inline]
 

Extracts property with specified name of type long from the special properties map.

Parameters:
name name of the property
defaultValue value returned if failed to obtain property value
Returns:
value, defaultValue on failure

Map<String, Object> alma::acs::logging::LogParameterUtil::extractSpecialPropertiesMap  )  [inline, package]
 

Tries to find the special properties map among the log parameters.

Returns:
the existing properties map from the current log record, or null if none is found.

String alma::acs::logging::LogParameterUtil::extractStringProperty String  name,
String  defaultValue
[inline]
 

Extracts property with specified name of type String from the special properties map.

Parameters:
name name of the property
defaultValue value returned if failed to obtain property value
Returns:
value, defaultValue on failure

List<Object> alma::acs::logging::LogParameterUtil::getNonSpecialPropertiesMapParameters  )  [inline]
 

Returns parameters of the current log record which are different from the special Properties Map. These parameters may still be of type Map.

The returned list is "live", so don't muck with it.

Returns:
array of parameters, possibly empty, but never null.

void alma::acs::logging::LogParameterUtil::setCurrentLogRecord LogRecord  logRecord  )  [inline]
 

Sets the log record from which the other methods can extract information. Also parses the special properties map and other parameters.

Parameters:
logRecord 


Member Data Documentation

LogRecord alma::acs::logging::LogParameterUtil::currentLogRecord [private]
 

final String alma::acs::logging::LogParameterUtil::IS_ACS_PROPERTIES_MAP_KEYNAME = "isAcsPropertiesMap" [static]
 

List<Object> alma::acs::logging::LogParameterUtil::otherParameters [private]
 

final String alma::acs::logging::LogParameterUtil::PARAM_HOSTNAME = "HostName" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_LINE = "Line" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_PRIORITY = "Priority" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_PROCESSNAME = "ProcessName" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_SOURCEOBJECT = "SourceObject" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_STACK_ID = "StackId" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_STACK_LEVEL = "StackLevel" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_THREAD_NAME = "ThreadName" [static]
 

final String alma::acs::logging::LogParameterUtil::PARAM_URI = "Uri" [static]
 

Map<String, Object> alma::acs::logging::LogParameterUtil::specialProperties [private]
 

A Mapthat is used as an optional special log parameter. It transports information from the application to the log formatter which could otherwise not be transported using the JDK's LogRecord.


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:40 2009 for ACS Java API by doxygen 1.3.8