com.ibm.mm.beans.workflow
Class CMBWorkFlowResourceCenter
java.lang.Object
|
+--com.ibm.mm.beans.workflow.CMBWorkFlowResourceCenter
- public class CMBWorkFlowResourceCenter
- extends java.lang.Object
Class provides central control over the translatable resources of EIP workflow beans,
includes:
messages design time and default runtime messages
This class initially loads message resource bundle
using system locale, and then caches these resource bunldes for future use
during the application session. You can call getBundle(String, Locale ) or
getBundle(String) to reload the specified resouce dynamically.
Field Summary |
static java.lang.String |
BASE_MESSAGE_BUNDLE
The message resource file containing design time and default runtime
messages. |
Method Summary |
static java.util.ResourceBundle |
getBundle(java.lang.String resName)
Get the specified resource bundle, re-loaded it with current locale. |
static java.util.ResourceBundle |
getBundle(java.lang.String resName,
java.util.Locale locale)
Get the specified resource bundle, re-loaded with the specified locale. |
static java.util.ResourceBundle |
getMessageBundle()
Get the message resource bundle. |
static java.lang.String |
getMessageString(java.lang.String key)
Get the message string from resource bundle |
static void |
setCurrentLocale(java.util.Locale locale)
Set the application-wide locale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_MESSAGE_BUNDLE
public static final java.lang.String BASE_MESSAGE_BUNDLE
- The message resource file containing design time and default runtime
messages. The files are:
CMBWorkFlowMessages.properties - for default locale and English
CMBWorkFlowMessages_it_IT.properties - for Italian
CMBWorkFlowMessages_ja_JP.properties - for Japanese
CMBWorkFlowMessages_zh_CN.properties - for simplified Chinese
etc.
Application designer can modify these files to provide default values global
to all applications.
CMBWorkFlowResourceCenter
public CMBWorkFlowResourceCenter()
setCurrentLocale
public static void setCurrentLocale(java.util.Locale locale)
throws java.util.MissingResourceException
- Set the application-wide locale. Calling this method will reload
message resource bundles using the specified locale. The loaded resource
bundles will then be cached for future use during the application session.
If application doesn't call this method at all, the locale used during
application session will be whatever the system locale is.
- Parameters:
locale
- the locale to use for the application- Throws:
java.util.MissingResourceException
- resource file not found
getMessageBundle
public static java.util.ResourceBundle getMessageBundle()
- Get the message resource bundle. This method gets cached resource bundle.
- Returns:
- the message resource bundle
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String resName)
throws java.util.MissingResourceException
- Get the specified resource bundle, re-loaded it with current locale. The
re-loaded bundle will NOT be cached.
- Parameters:
resName
- the resource bundle property file name- Returns:
- the specified resource bundle, or
null
if file not found - Throws:
java.util.MissingResourceException
- resource file not found
getBundle
public static java.util.ResourceBundle getBundle(java.lang.String resName,
java.util.Locale locale)
throws java.util.MissingResourceException
- Get the specified resource bundle, re-loaded with the specified locale.
This method can be used to load resource with locale other than the current.
It will not change application current locale. The re-loaded bundle will NOT
be cached.
- Parameters:
resName
- the resource bundle property file namelocale
- the locale to load resource bundle- Returns:
- the specified resource bundle
getMessageString
public static java.lang.String getMessageString(java.lang.String key)
- Get the message string from resource bundle
- Parameters:
key
- the resource ID- Returns:
- the resource value
(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.