com.atlassian.user.impl.cache.properties
Class CachingPropertySetFactory
java.lang.Object
com.atlassian.user.impl.cache.properties.CachingPropertySetFactory
- All Implemented Interfaces:
- PropertySetFactory
- public class CachingPropertySetFactory
- extends java.lang.Object
- implements PropertySetFactory
A PropertySetFactory that wraps another PropertySetFactory and maintains a cache of its PropertySet
s. This
prevents the need for PropertySets to be looked up repeatedly from the wrapped PropertySetFactory.
Retrieved PropertySets are also wrapped in a CachedPropertySet so that individual property values are cached
instead of repeatedly retrieved. Both levels of caching rewrite to the cache whenever a setter is
called on a PropertySet
.
The cache is keyed purely on entity name, so it assumes all entities
used have unique names, even across entity types.
Since the decorated PropertySets retrieved from the underlyingPropertySetFactory
are cached
they must be Serializable
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingPropertySetFactory
public CachingPropertySetFactory(PropertySetFactory underlyingPropertySetFactory,
com.atlassian.cache.CacheFactory cacheFactory)
getPropertySet
public com.opensymphony.module.propertyset.PropertySet getPropertySet(Entity entity)
throws EntityException
- Specified by:
getPropertySet
in interface PropertySetFactory
- Parameters:
entity
- the instance of Entity
for which a PropertySet
should be retrieved.
- Returns:
- an instance of
PropertySet
for the Entity
, otherwise null.
- Throws:
EntityException
Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.