no.sesat.search.site
Class AbstractSiteKeyedFactory
java.lang.Object
no.sesat.search.site.AbstractSiteKeyedFactory
- All Implemented Interfaces:
- SiteKeyedFactory
public abstract class AbstractSiteKeyedFactory
- extends Object
- implements SiteKeyedFactory
Abstract implementation of a SiteKeyedFactory to help with
the INSTANCES map and locking pattern typically used around it using ReentrantReadWriteLocks.
- Version:
- $Id: AbstractSiteKeyedFactory.java 7225 2009-04-09 00:32:20Z ssmiweve $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSiteKeyedFactory
protected AbstractSiteKeyedFactory()
instanceOf
protected static final <T extends AbstractSiteKeyedFactory> T instanceOf(Site site,
Map<Site,T> instances,
ReentrantReadWriteLock instancesLock,
AbstractSiteKeyedFactory.FactoryConstructor<T> constructor)
- Handles the locking pattern around the INSTANCES map that's done with a ReentrantReadWriteLock.
- Type Parameters:
T - the type of SiteKeyedFactory that can be constructed.- Parameters:
site - the site this factory will answer to.instances - the map of factories of type T already in existence.instancesLock - the lock used around the instances mapconstructor - the wrapper around the constructor used to create factories of type T.
- Returns:
- the singleton instance of factory of type T related to the given site.
- See Also:
http://permalink.gmane.org/gmane.comp.java.sesat.kernel.devel/228
Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.