@Test public void storeIfAbsentEntityTest() { portletEntityCache.storeEntity(portletEntityDescriptor); IPortletEntityDescriptor _result = portletEntityCache.getEntity("u18l1n1203", 60); assertNotNull(_result); assertEquals(_result.getPortletDefinitionId(), portletDefinitionId); assertEquals(_result.getPortletEntityId(), portletEntityId); portletEntityCache.removeEntity(portletEntityId); }
public T storeIfAbsentEntity( IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator) { T existingEntity = this.getEntity(portletEntityId); if (existingEntity != null) { return existingEntity; } writeLock.lock(); try { existingEntity = this.entitiesById.get(portletEntityId); if (existingEntity != null) { return existingEntity; } final T entity = entityCreator.apply(portletEntityId); this.storeEntity(entity); return entity; } finally { writeLock.unlock(); } }
PortletEntityCache implements Serializable { public T storeIfAbsentEntity( IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator) { T existingEntity = this.getEntity(portletEntityId); if (existingEntity != null) { return existingEntity; } writeLock.lock(); try { existingEntity = this.entitiesById.get(portletEntityId); if (existingEntity != null) { return existingEntity; } final T entity = entityCreator.apply(portletEntityId); this.storeEntity(entity); return entity; } finally { writeLock.unlock(); } } }
PortletEntityCache implements Serializable { public T storeIfAbsentEntity( IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator) { T existingEntity = this.getEntity(portletEntityId); if (existingEntity != null) { return existingEntity; } writeLock.lock(); try { existingEntity = this.entitiesById.get(portletEntityId); if (existingEntity != null) { return existingEntity; } final T entity = entityCreator.apply(portletEntityId); this.storeEntity(entity); return entity; } finally { writeLock.unlock(); } } PortletEntityCache();  PortletEntityCache(boolean threadSafe); }
PortletEntityCache implements Serializable { public T storeIfAbsentEntity( IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator) { T existingEntity = this.getEntity(portletEntityId); if (existingEntity != null) { return existingEntity; } writeLock.lock(); try { existingEntity = this.entitiesById.get(portletEntityId); if (existingEntity != null) { return existingEntity; } final T entity = entityCreator.apply(portletEntityId); this.storeEntity(entity); return entity; } finally { writeLock.unlock(); } } PortletEntityCache();  PortletEntityCache(boolean threadSafe); T storeIfAbsentEntity(
            IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator); T storeIfAbsentEntity(T entity); void storeEntity(T entity); T getEntity(String layoutNodeId, int userId); T getEntity(IPortletEntityId portletEntityId); void removeEntity(IPortletEntityId portletEntityId); }
PortletEntityCache implements Serializable { public T storeIfAbsentEntity( IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator) { T existingEntity = this.getEntity(portletEntityId); if (existingEntity != null) { return existingEntity; } writeLock.lock(); try { existingEntity = this.entitiesById.get(portletEntityId); if (existingEntity != null) { return existingEntity; } final T entity = entityCreator.apply(portletEntityId); this.storeEntity(entity); return entity; } finally { writeLock.unlock(); } } PortletEntityCache();  PortletEntityCache(boolean threadSafe); T storeIfAbsentEntity(
            IPortletEntityId portletEntityId, Function<IPortletEntityId, T> entityCreator); T storeIfAbsentEntity(T entity); void storeEntity(T entity); T getEntity(String layoutNodeId, int userId); T getEntity(IPortletEntityId portletEntityId); void removeEntity(IPortletEntityId portletEntityId);  }