com.atlassian.confluence.search.v2.lucene
Class ThreadCachedSearchMapperRegistry

java.lang.Object
  extended by com.atlassian.confluence.search.v2.lucene.ThreadCachedSearchMapperRegistry
All Implemented Interfaces:
LuceneSearchMapperRegistry

public class ThreadCachedSearchMapperRegistry
extends java.lang.Object
implements LuceneSearchMapperRegistry

A facade onto the PluggableLuceneSearchMapperRegistry which will first look for a ThreadLocal cache of available search mappers before delegating.

This is necessary due to the current slowness involved in looking up available search mappers from the plugin subsystem (see CONF-11920). The architectural strategy in Confluence is to move away from diverse caches spread about the software - this class is a compromise in that the cache it uses will only exist for the duration of the single search being performed.

This class should be considered in conjunction with the LuceneSearchManager which is responsible for creating and removing the thread local cache of available mappers.


Constructor Summary
ThreadCachedSearchMapperRegistry(LuceneSearchMapperRegistry delegateRegistry)
          Construct with the supplied registry to be used when mappers are not found in the thread local cache.
 
Method Summary
 LuceneQueryMapper getQueryMapper(java.lang.String key)
           
 LuceneResultFilterMapper getResultFilterMapper(java.lang.String key)
           
 LuceneSearchFilterMapper getSearchFilterMapper(java.lang.String key)
           
 LuceneSortMapper getSortMapper(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadCachedSearchMapperRegistry

public ThreadCachedSearchMapperRegistry(LuceneSearchMapperRegistry delegateRegistry)
Construct with the supplied registry to be used when mappers are not found in the thread local cache.

Parameters:
delegateRegistry -
Method Detail

getQueryMapper

public LuceneQueryMapper getQueryMapper(java.lang.String key)
Specified by:
getQueryMapper in interface LuceneSearchMapperRegistry

getResultFilterMapper

public LuceneResultFilterMapper getResultFilterMapper(java.lang.String key)
Specified by:
getResultFilterMapper in interface LuceneSearchMapperRegistry

getSortMapper

public LuceneSortMapper getSortMapper(java.lang.String key)
Specified by:
getSortMapper in interface LuceneSearchMapperRegistry

getSearchFilterMapper

public LuceneSearchFilterMapper getSearchFilterMapper(java.lang.String key)
Specified by:
getSearchFilterMapper in interface LuceneSearchMapperRegistry
Parameters:
key - the key of the SearchFilter to fetch a mapper for
Returns:
a mapper for a search filter with the specified key


Copyright © 2003-2009 Atlassian Pty Ltd. All Rights Reserved.