Author: ron.sigal(a)jboss.com
Date: 2008-12-29 16:42:21 -0500 (Mon, 29 Dec 2008)
New Revision: 4768
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshalFactory.java
Log:
JBREM-1072: Made static maps synchronized collections.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshalFactory.java
===================================================================
---
remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshalFactory.java 2008-12-29
21:39:26 UTC (rev 4767)
+++
remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/MarshalFactory.java 2008-12-29
21:42:21 UTC (rev 4768)
@@ -31,6 +31,7 @@
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -46,10 +47,10 @@
*/
public class MarshalFactory
{
- private static Map marshallers = new HashMap();
- private static Map unmarshallers = new HashMap();
- private static Map classMarshallers = new HashMap();
- private static Map classUnmarshallers = new HashMap();
+ private static Map marshallers = Collections.synchronizedMap(new HashMap());
+ private static Map unmarshallers = Collections.synchronizedMap(new HashMap());
+ private static Map classMarshallers = Collections.synchronizedMap(new HashMap());
+ private static Map classUnmarshallers = Collections.synchronizedMap(new HashMap());
protected final static Logger log = Logger.getLogger(MarshalFactory.class);