Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2338 - development/main/transit/util/i18n/src/main/net/dpml/i18n

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT hedhman.org
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2338 - development/main/transit/util/i18n/src/main/net/dpml/i18n
  • Date: Wed, 20 Apr 2005 19:57:08 -0400

Author: niclas AT hedhman.org
Date: Wed Apr 20 19:57:04 2005
New Revision: 2338

Modified:

development/main/transit/util/i18n/src/main/net/dpml/i18n/ResourceManager.java
Log:
Added support to handle Locale in I18N ResourceManager.

Modified:
development/main/transit/util/i18n/src/main/net/dpml/i18n/ResourceManager.java
==============================================================================
---
development/main/transit/util/i18n/src/main/net/dpml/i18n/ResourceManager.java
(original)
+++
development/main/transit/util/i18n/src/main/net/dpml/i18n/ResourceManager.java
Wed Apr 20 19:57:04 2005
@@ -20,6 +20,7 @@

import java.lang.ref.WeakReference;
import java.util.HashMap;
+import java.util.Locale;

/**
* Manager for resources.
@@ -71,6 +72,27 @@
}

/**
+ * Retrieve resource with specified basename.
+ *
+ * @param baseName the basename
+ * @param classLoader the classLoader to load resources from
+ * @return the Resources
+ */
+ public static final synchronized Resources getBaseResources( final
String baseName,
+ final
Locale locale,
+ final
ClassLoader classLoader )
+ {
+ Resources resources = getCachedResource( baseName + "_" +
locale.hashCode() );
+ if( null == resources )
+ {
+ resources = new Resources( baseName, locale, classLoader );
+ putCachedResource( baseName + "_" + locale.hashCode(), resources
);
+ }
+
+ return resources;
+ }
+
+ /**
* Clear the cache of all resources currently loaded into the
* system. This method is useful if you need to dump the complete
* cache and because part of the application is reloading and



  • svn commit: r2338 - development/main/transit/util/i18n/src/main/net/dpml/i18n, niclas, 04/20/2005

Archive powered by MHonArc 2.6.24.

Top of Page