Author: hoang_to
Date: 2010-11-01 21:28:58 -0400 (Mon, 01 Nov 2010)
New Revision: 4894
Modified:
portal/branches/branch-GTNPORTAL-1592/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java
Log:
GTNPORTAL-1541: Concurrency problem in Breadcumbs portlet
Modified:
portal/branches/branch-GTNPORTAL-1592/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1592/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java 2010-11-01
21:25:30 UTC (rev 4893)
+++
portal/branches/branch-GTNPORTAL-1592/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java 2010-11-02
01:28:58 UTC (rev 4894)
@@ -176,21 +176,33 @@
public Event getUIComponentEventConfig(String eventName) throws Exception
{
- if (eventMap != null)
+ if(eventMap == null)
{
- return eventMap.get(eventName);
+ synchronized(this)
+ {
+ if(eventMap == null)
+ {
+ eventMap = new HashMap<String, Event>();
+
+ if (events == null)
+ {
+ return null;
+ }
+
+ for (Event event : events)
+ {
+ createCachedEventListeners(event);
+ eventMap.put(event.getName(), event);
+ }
+ }
+
+ return eventMap.get(eventName);
+ }
}
- eventMap = new HashMap<String, Event>();
- if (events == null)
+ else
{
- return null;
+ return eventMap.get(eventName);
}
- for (Event event : events)
- {
- createCachedEventListeners(event);
- eventMap.put(event.getName(), event);
- }
- return eventMap.get(eventName);
}
public List<EventListener> getUIComponentEventListeners(String eventName) throws
Exception
Show replies by date