@Test public void storeIfAbsentWindowTest() { portletWindowCache.storeIfAbsentWindow(portletWindowDescriptor); Set windows = portletWindowCache.getWindows(portletEntityId); assertNotNull(windows); assertEquals(windows.size(), 1); IPortletWindowDescriptor _descriptor_ = (IPortletWindowDescriptor) windows.iterator().next(); assertEquals(_descriptor_.getPortletEntityId(), portletEntityId); assertEquals(_descriptor_.getPortletWindowId(), portletWindowId); IPortletWindowDescriptor _portletWindowDescriptor_ = portletWindowCache.getWindow(portletWindowId); assertEquals(_portletWindowDescriptor_.getPortletEntityId(), portletEntityId); }
public T storeIfAbsentWindow(T window) { final IPortletWindowId portletWindowId = window.getPortletWindowId(); T existingWindow = this.getWindow(portletWindowId); if (existingWindow != null) { return existingWindow; } writeLock.lock(); try { existingWindow = this.windowsById.get(portletWindowId); if (existingWindow != null) { return existingWindow; } this.storeWindow(window); } finally { writeLock.unlock(); } return window; }
PortletWindowCache implements Serializable { public T storeIfAbsentWindow(T window) { final IPortletWindowId portletWindowId = window.getPortletWindowId(); T existingWindow = this.getWindow(portletWindowId); if (existingWindow != null) { return existingWindow; } writeLock.lock(); try { existingWindow = this.windowsById.get(portletWindowId); if (existingWindow != null) { return existingWindow; } this.storeWindow(window); } finally { writeLock.unlock(); } return window; } }
PortletWindowCache implements Serializable { public T storeIfAbsentWindow(T window) { final IPortletWindowId portletWindowId = window.getPortletWindowId(); T existingWindow = this.getWindow(portletWindowId); if (existingWindow != null) { return existingWindow; } writeLock.lock(); try { existingWindow = this.windowsById.get(portletWindowId); if (existingWindow != null) { return existingWindow; } this.storeWindow(window); } finally { writeLock.unlock(); } return window; } PortletWindowCache();  PortletWindowCache(boolean threadSafe); }
PortletWindowCache implements Serializable { public T storeIfAbsentWindow(T window) { final IPortletWindowId portletWindowId = window.getPortletWindowId(); T existingWindow = this.getWindow(portletWindowId); if (existingWindow != null) { return existingWindow; } writeLock.lock(); try { existingWindow = this.windowsById.get(portletWindowId); if (existingWindow != null) { return existingWindow; } this.storeWindow(window); } finally { writeLock.unlock(); } return window; } PortletWindowCache();  PortletWindowCache(boolean threadSafe); T storeIfAbsentWindow(T window); void storeWindow(T window); boolean containsWindow(IPortletWindowId portletWindowId); Set<T> getWindows(IPortletEntityId portletEntityId); T getWindow(IPortletWindowId portletWindowId); }
PortletWindowCache implements Serializable { public T storeIfAbsentWindow(T window) { final IPortletWindowId portletWindowId = window.getPortletWindowId(); T existingWindow = this.getWindow(portletWindowId); if (existingWindow != null) { return existingWindow; } writeLock.lock(); try { existingWindow = this.windowsById.get(portletWindowId); if (existingWindow != null) { return existingWindow; } this.storeWindow(window); } finally { writeLock.unlock(); } return window; } PortletWindowCache();  PortletWindowCache(boolean threadSafe); T storeIfAbsentWindow(T window); void storeWindow(T window); boolean containsWindow(IPortletWindowId portletWindowId); Set<T> getWindows(IPortletEntityId portletEntityId); T getWindow(IPortletWindowId portletWindowId);  }