| java.lang.Object com.sun.jbi.common.Util
Util | public class Util (Code) | | This is an utility class which provides an interface to access the string tran
author: Srinivas Kondapalli |
Method Summary | |
public static ManagementMessageBuilder | createManagementMessageBuilder() Creates a new management message builder instance. | public static synchronized StringTranslator | getStringTranslator(String packageName) Get the StringTranslator for a specified package name.
Parameters: packageName - - the name of the package containing the resource bundle to beused by this StringTranslator. | public static StringTranslator | getStringTranslatorFor(Object object) Get the StringTranslator for a specified object.
Parameters: object - - an object in the package that contains the resource bundle to beused for this StringTranslator. | public static void | log(StringTranslator stringTranslator, Logger logger, Level level, String key) A helper method to efficiently log an internationalized message. | public static void | log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object insert) A helper method to efficiently log an internationalized message. | public static void | log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object insert1, Object insert2) A helper method to efficiently log an internationalized message. | public static void | log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object[] inserts) A helper method to efficiently log an internationalized message. | public static void | logExceptionTrace(Exception exception, Logger logger, Level level) Logs the exception stack trace using the defined logger instance at the prescribed
level. | public static void | logExceptionTrace(Exception exception, Logger logger) Logs the exception stack trace using the defined logger. |
createManagementMessageBuilder | public static ManagementMessageBuilder createManagementMessageBuilder()(Code) | | Creates a new management message builder instance.
a management message builder implementation instance. |
getStringTranslator | public static synchronized StringTranslator getStringTranslator(String packageName)(Code) | | Get the StringTranslator for a specified package name.
Parameters: packageName - - the name of the package containing the resource bundle to beused by this StringTranslator. The StringTranslator instance. |
getStringTranslatorFor | public static StringTranslator getStringTranslatorFor(Object object)(Code) | | Get the StringTranslator for a specified object.
Parameters: object - - an object in the package that contains the resource bundle to beused for this StringTranslator. The StringTranslator instance. |
log | public static void log(StringTranslator stringTranslator, Logger logger, Level level, String key)(Code) | | A helper method to efficiently log an internationalized message. The method uses
the StringTranslator to get the internationalized only if the configured log
level is greater than or equal to the prescribed log level. It is recommended
that clients use
Util.log( stringTranslator, logger, Level.FINE, key);
instead of
logger.fine(stringTranslator.getString(key));
Parameters: stringTranslator - the stringTranslator implementation to be used Parameters: logger - the logger instance to be used Parameters: level - the prescribed log level Parameters: key - the key to the localized string in the resource bundle |
log | public static void log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object insert)(Code) | | A helper method to efficiently log an internationalized message. The method uses
the StringTranslator to get the internationalized only if the configured log
level is greater than or equal to the prescribed log level. This is a helper
method which can be used when the inserts length is 1.
Parameters: stringTranslator - the stringTranslator implementation to be used Parameters: logger - the logger instance to be used Parameters: level - the prescribed log level Parameters: key - the key to the localized string in the resource bundle Parameters: insert - the object value to be inserted. |
log | public static void log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object insert1, Object insert2)(Code) | | A helper method to efficiently log an internationalized message. The method uses
the StringTranslator to get the internationalized only if the configured log
level is greater than or equal to the prescribed log level. This is a helper
method which can be used when the inserts length is 2.
Parameters: stringTranslator - the stringTranslator implementation to be used Parameters: logger - the logger instance to be used Parameters: level - the prescribed log level Parameters: key - the key to the localized string in the resource bundle Parameters: insert1 - the first object value to be inserted. Parameters: insert2 - the second object value to be inserted. |
log | public static void log(StringTranslator stringTranslator, Logger logger, Level level, String key, Object[] inserts)(Code) | | A helper method to efficiently log an internationalized message. The method uses
the StringTranslator to get the internationalized only if the configured log
level is greater than or equal to the prescribed log level. It is recommended
that clients use
Util.log( stringTranslator, logger, Level.FINE, key, inserts);
instead of
logger.fine(stringTranslator.getString(key, inserts));
Parameters: stringTranslator - the stringTranslator implementation to be used Parameters: logger - the logger instance to be used Parameters: level - the prescribed log level Parameters: key - the key to the localized string in the resource bundle Parameters: inserts - the array of message inserts. |
logExceptionTrace | public static void logExceptionTrace(Exception exception, Logger logger, Level level)(Code) | | Logs the exception stack trace using the defined logger instance at the prescribed
level.
Parameters: exception - exception instance thrown by the application. Parameters: logger - logger instance to be used. Parameters: level - prescribed level. |
logExceptionTrace | public static void logExceptionTrace(Exception exception, Logger logger)(Code) | | Logs the exception stack trace using the defined logger. It logs the
exception trace using a default level of SEVERE.
Parameters: exception - exception instance thrown by the application. Parameters: logger - logger instance to be used |
|
|