org.rhq.enterprise.server.alert.i18n
Class AlertI18NFactory

java.lang.Object
  extended by org.rhq.enterprise.server.alert.i18n.AlertI18NFactory

public class AlertI18NFactory
extends Object

Convenience utility that creates I18N loggers and messages for you in the alerts subsystem SLSB and weblayer-related classes. These factory methods are used to create I18N objects that access the corresponding property resource bundle.

Author:
Joseph Marques

Constructor Summary
AlertI18NFactory()
           
 
Method Summary
static mazz.i18n.Logger getLogger(Class<?> clazz)
          Creates the logger and uses the LoggerLocale.
static String getMessage(String alertI18NKeyName, Object... args)
          Returns the string formed by parameter replacement of the arguments in alertI18NKeyName with args This uses a newly created Msg from the alert resource bundle along with the VM's default locale.
static mazz.i18n.Msg getMsg()
          Creates a Msg that uses the alert's resource bundle and the VM's default locale.
static mazz.i18n.Msg getMsgWithLoggerLocale()
          Creates a Msg that uses the alert's resource bundle and LoggerLocale, which is used by the loggers created by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertI18NFactory

public AlertI18NFactory()
Method Detail

getLogger

public static mazz.i18n.Logger getLogger(Class<?> clazz)
Creates the logger and uses the LoggerLocale.

Parameters:
clazz - the class that owns the logger - identifies the resource bundle
Returns:
the logger

getMsg

public static mazz.i18n.Msg getMsg()
Creates a Msg that uses the alert's resource bundle and the VM's default locale.

Returns:
object that can be used to look up I18N messages

getMessage

public static String getMessage(String alertI18NKeyName,
                                Object... args)
Returns the string formed by parameter replacement of the arguments in alertI18NKeyName with args This uses a newly created Msg from the alert resource bundle along with the VM's default locale.

Parameters:
alertI18NKeyName - one of the keys from AlertI18NResourceKeys
args - the arguments that would match up with the replacement parameters from the first argument
Returns:
object that can be used to look up I18N messages

getMsgWithLoggerLocale

public static mazz.i18n.Msg getMsgWithLoggerLocale()
Creates a Msg that uses the alert's resource bundle and LoggerLocale, which is used by the loggers created by this class. This is useful if you want to set messages in exceptions that are simply to be logged and not necessarily be bubbled up to a user interface.

Returns:
object that can be used to look up I18N messages


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.