Class CachingPropertySetFactory

All Implemented Interfaces:

public class CachingPropertySetFactory
extends java.lang.Object
implements PropertySetFactory

A PropertySetFactory that wraps another PropertySetFactory and maintains a cache of its PropertySets. 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.

Constructor Summary
CachingPropertySetFactory(PropertySetFactory underlyingPropertySetFactory, com.atlassian.cache.CacheFactory cacheFactory)
Method Summary
 com.opensymphony.module.propertyset.PropertySet getPropertySet(Entity entity)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CachingPropertySetFactory(PropertySetFactory underlyingPropertySetFactory,
                                 com.atlassian.cache.CacheFactory cacheFactory)
Method Detail


public com.opensymphony.module.propertyset.PropertySet getPropertySet(Entity entity)
                                                               throws EntityException
Specified by:
getPropertySet in interface PropertySetFactory
entity - the instance of Entity for which a PropertySet should be retrieved.
an instance of PropertySet for the Entity, otherwise null.

Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.