Hi Berin,
On Tue, Dec 18, 2001 at 02:23:24PM -0500, Berin Loritsch wrote:
> > components */
> > private Parameters emptyParam = new Parameters();
> >
> > /** HashMap relating labels to view names */
> > private HashMap view_label_map = new HashMap(1);
> >
> > The 'emptyParam' is passed into several cocoon components. If a
> > developer sets a parameter in a selector for example, then 2
> > threads can overwrite each other with different results (the current
> > problem we have here).
>
> Is emptyParam supposed to be a read-only object, or something that is
> started at the beginning of a pipeline?
I'm not sure if it's mean't to be read-only, as that code has been
around for a long time, and I'm not sure what the initial intentions
were by the developer that wrote it.
I think it would be more useful if it was started at the
beginning of a pipeline. Then it's at least separate from all other
pipelines, and threads.
What do you think ?
> > If the Parameters object remains thread unsafe, perhaps it should be
> > documented in it's class level javadocs like the Collection
> > classes so it's obvious to the developer (I'll submit a patch if
> > you like ?).
>
> Sounds good.
Attached. Hope it's ok.
Cheers,
Marcus
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&' Email : [EMAIL PROTECTED]
&&&&. Business Hours : +49 69 9757 200
&&&&&&&:
Index: src/java/org/apache/avalon/framework/parameters/Parameters.java
===================================================================
RCS file:
/home/cvspublic/jakarta-avalon/src/java/org/apache/avalon/framework/parameters/Parameters.java,v
retrieving revision 1.16
diff -u -r1.16 Parameters.java
--- src/java/org/apache/avalon/framework/parameters/Parameters.java
2001/12/11 09:00:47 1.16
+++ src/java/org/apache/avalon/framework/parameters/Parameters.java
2001/12/19 12:36:47
@@ -21,6 +21,10 @@
* Each value stored in Parameters has a key.
* This class is similar to java.util.Properties with convenience methods
* to access property values by type.
+ * <p />
+ * <strong>Note, this class is by default not thread safe</strong>. If you
+ * require thread safety please synchronize write access to this class to
+ * prevent potential data corruption.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>