Class DefaultQueryPreprocessorRegistry

java.lang.Object
de.hybris.platform.servicelayer.search.internal.preprocessor.impl.DefaultQueryPreprocessorRegistry
All Implemented Interfaces:
QueryPreprocessorRegistry

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 Details

    • DefaultQueryPreprocessorRegistry

      public DefaultQueryPreprocessorRegistry()
  • Method Details