Class DefaultQueryPreprocessorRegistry
java.lang.Object
de.hybris.platform.servicelayer.search.internal.preprocessor.impl.DefaultQueryPreprocessorRegistry
- All Implemented Interfaces:
QueryPreprocessorRegistry
Default implementation of QueryPreprocessorRegistry interface.
Please notice that because registered QueryPreprocessor implementations can have any dependencies, thus
it can lead to circular dependency problem. To avoid this problem this class must be used with
lookup-method as follows:
Java class
public class DefaultFlexibleSearchService extends AbstractBusinessService implements FlexibleSearchService
{
...
private volatile QueryPreprocessorRegistry queryPreprocessorRegistry;
public QueryPreprocessorRegistry getQueryPreprocessorRegistry()
{
if (queryPreprocessorRegistry == null)
{
synchronized (this)
{
if (queryPreprocessorRegistry == null)
{
queryPreprocessorRegistry = lookupQueryPreprocessorRegistry();
}
}
}
return queryPreprocessorRegistry;
}
public QueryPreprocessorRegistry lookupQueryPreprocessorRegistry()
{
throw new UnsupportedOperationException(
"please override DefaultFlexibleSearchService#lookupQueryPreprocessorRegistry() or use <lookup-method>");
}
...
}
Spring context configuration
<bean id="defaultFlexibleSearchService" parent="abstractBusinessService" class="de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService" >
...
<lookup-method name="lookupQueryPreprocessorRegistry" bean="queryPreprocessorRegistry"/>
...
</bean>
<bean id="queryPreprocessorRegistry" class="de.hybris.platform.servicelayer.search.internal.preprocessor.impl.DefaultQueryPreprocessorRegistry" autowire="byType" />
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIterates over all registered preprocessors and executes each againstFlexibleSearchQueryobject.voidsetQueryPreprocessors(Map<String, QueryPreprocessor> queryPreprocessors)
-
Constructor Details
-
DefaultQueryPreprocessorRegistry
public DefaultQueryPreprocessorRegistry()
-
-
Method Details
-
executeAllPreprocessors
Iterates over all registered preprocessors and executes each againstFlexibleSearchQueryobject.- Specified by:
executeAllPreprocessorsin interfaceQueryPreprocessorRegistry- Parameters:
query-FlexibleSearchQueryobject.
-
setQueryPreprocessors
-