Return-Path:
Delivered-To: apmail-jakarta-hivemind-cvs-archive@www.apache.org
Received: (qmail 79331 invoked from network); 11 Feb 2005 15:29:57 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
by minotaur-2.apache.org with SMTP; 11 Feb 2005 15:29:57 -0000
Received: (qmail 6823 invoked by uid 500); 11 Feb 2005 15:29:56 -0000
Delivered-To: apmail-jakarta-hivemind-cvs-archive@jakarta.apache.org
Received: (qmail 6807 invoked by uid 500); 11 Feb 2005 15:29:56 -0000
Mailing-List: contact hivemind-cvs-help@jakarta.apache.org; run by ezmlm
Precedence: bulk
list-help:
list-unsubscribe:
list-post:
Reply-To: hivemind-dev@jakarta.apache.org
Delivered-To: mailing list hivemind-cvs@jakarta.apache.org
Received: (qmail 6792 invoked by uid 99); 11 Feb 2005 15:29:56 -0000
X-ASF-Spam-Status: No, hits=-9.8 required=10.0
tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from minotaur.apache.org (HELO minotaur.apache.org)
(209.237.227.194)
by apache.org (qpsmtpd/0.28) with SMTP; Fri, 11 Feb 2005 07:29:54 -0800
Received: (qmail 79313 invoked by uid 1616); 11 Feb 2005 15:29:53 -0000
Date: 11 Feb 2005 15:29:53 -0000
Message-ID: <20050211152953.79312.qmail@minotaur.apache.org>
From: hlship@apache.org
To: jakarta-hivemind-cvs@apache.org
Subject: cvs commit:
jakarta-hivemind/examples/src/test/com/panorama/startup/impl
TestTaskExecutor.java
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N
hlship 2005/02/11 07:29:53
Modified: framework/src/documentation/content/xdocs/hivemind
ThreadLocalStorage.xml
src/documentation/content/xdocs index.xml site.xml links.ent
localization.xml
framework/src/descriptor/META-INF hivemodule.xml
framework/src/java/org/apache/hivemind/impl ModuleImpl.java
MessageFormatter.java
. status.xml
framework/src/java/org/apache/hivemind Messages.java
HiveMind.java
examples/src/test/com/panorama/startup/impl
TestTaskExecutor.java
Added: framework/src/documentation/content/xdocs/hivemind
ThreadLocale.xml
framework/src/java/org/apache/hivemind/service/impl
ThreadLocaleFactory.java ThreadLocaleImpl.java
framework/src/java/org/apache/hivemind/impl
MessageFinderImpl.java ModuleMessages.java
AbstractMessages.java
framework/src/java/org/apache/hivemind/service
ThreadLocale.java
framework/src/test/org/apache/hivemind TestThreadLocale.java
framework/src/java/org/apache/hivemind/internal
MessageFinder.java
framework/src/test/org/apache/hivemind/impl
MessageFinder_fr.properties TestMessageFinder.java
MessageFinder.properties
Removed: framework/src/java/org/apache/hivemind/impl
MessagesImpl.java
framework/src/test/hivemind/test TestMessagesImpl.java
Log:
Allow locale to be changed for each thread.
Revision Changes Path
1.7 +14 -21 jakarta-hivemind/framework/src/documentation/content/xdocs/hivemind/ThreadLocalStorage.xml
Index: ThreadLocalStorage.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/framework/src/documentation/content/xdocs/hivemind/ThreadLocalStorage.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ThreadLocalStorage.xml 6 Jan 2005 01:45:14 -0000 1.6
+++ ThreadLocalStorage.xml 11 Feb 2005 15:29:51 -0000 1.7
@@ -14,25 +14,18 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
- %common-links;
- ]>
+
+
+ %common-links;
+ ]>
-
- hivemind.ThreadLocalStorage Service
-
-
-
The
- ThreadLocalStorage service implements the ThreadLocalStorage
- interface. This service acts as a kind of Map for temporary data. The map
- is local to the current thread, and is cleared at the end of the
- transaction.
-
It is your responsibility to ensure that keys are unique, typically by
- prefixing them with a module id or package name.
-
-
+
+ hivemind.ThreadLocalStorage Service
+
+
+
The ThreadLocalStorage service implements the ThreadLocalStorage interface. This service acts as a kind of Map for temporary data. The map is local to the current thread, and is cleared at the end of the transaction.
+
It is your responsibility to ensure that keys are unique, typically by prefixing them with a module id or package name.
+ ThreadLocalStorage is likely to be removed in a future release of HiveMind. It is advised that you use the threaded service model instead.
+
+
\ No newline at end of file
1.1 jakarta-hivemind/framework/src/documentation/content/xdocs/hivemind/ThreadLocale.xml
Index: ThreadLocale.xml
===================================================================
%common-links;
]>
hivemind.ThreadLocale Service
The
ThreadLocale service implements the ThreadLocale
interface. This service stores the current thread's locale. You may use
this service to read or update the thread's current locale.
You can now omit the package name (generally) when specifying class name in a module descriptor.
The &module; element's package attribute provides the package name to use.
+
+
+ The locale (used for localized messages) is no longer fixed, as it was in 1.0. You can change
+ the locale using the &hivemind.ThreadLocale; service.
+
The two keys (message.key and other.message.key
) are searched for in the contributing module's messages.
+
+
+ Support for this '%' syntax will likely be removed soon. This is because
+ the locale is now changeable; what locale to use when converting configuration
+ data becomes dangerously ambiguous.
+
+
HiveMind gracefully recovers from undefined messages. If a message is not
in the properties file, then HiveMind provides a substitute value by
converting the key to upper-case and adding brackets, i.e.
@@ -56,11 +63,30 @@
example, adding a second file, META-INF/hivemodule_fr.properties
would provide French language localizations. Any common keys between the
two files defer to the more specific file.
+
+
+ The &hivemind.BuilderFactory; can inject an &api.Messages; object that allows access
+ to the module's messages.
+
Setting the locale
When a &api.Registry; is created by the &api.RegistryBuilder;, a locale
- is specified. This is the locale for the Registry and, by extension, for
- all Modules in the registry. The locale may not be changed.
+ is specified. This is the default locale for the Registry and, by extension, for
+ all Modules in the registry.
+
+
+ Threads will always use this locale by default, but the locale for
+ an individual thread may be changed using the &hivemind.ThreadLocale; service.
+ The &api.Messages; injected into your services automatically adjusts for the
+ thread's current locale.
+
+
+
+ You should not store, in your services, any localized values, since different threads
+ may want different localizations. Instead, you should always obtain values
+ from the &api.Messages;.
+