public class DefaultQueryPreprocessorRegistry extends Object implements 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 and Description |
|---|
DefaultQueryPreprocessorRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
executeAllPreprocessors(FlexibleSearchQuery query)
Iterates over all registered preprocessors and executes each against
FlexibleSearchQuery object. |
void |
setQueryPreprocessors(Map<String,QueryPreprocessor> queryPreprocessors) |
public void executeAllPreprocessors(FlexibleSearchQuery query)
FlexibleSearchQuery object.executeAllPreprocessors in interface QueryPreprocessorRegistryquery - FlexibleSearchQuery object.public void setQueryPreprocessors(Map<String,QueryPreprocessor> queryPreprocessors)
Copyright © 2017 SAP SE. All Rights Reserved.