protected void initializeQueryHandler ( ) throws RepositoryException , RepositoryConfigurationException { // initialize query handler String className = config . getType ( ) ; if ( className == null ) { throw new RepositoryConfigurationException ( "Content hanler configuration fail" ) ; } try { Class < ? > qHandlerClass = ClassLoading . forName ( className , this ) ; try { // We first try a constructor with the workspace id Constructor < ? > constuctor = qHandlerClass . getConstructor ( String . class , QueryHandlerEntry . class , ConfigurationManager . class ) ; handler = ( QueryHandler ) constuctor . newInstance ( wsContainerId , config , cfm ) ; } catch ( NoSuchMethodException e ) { // No constructor with the workspace id can be found so we use the default constructor Constructor < ? > constuctor = qHandlerClass . getConstructor ( QueryHandlerEntry . class , ConfigurationManager . class ) ; handler = ( QueryHandler ) constuctor . newInstance ( config , cfm ) ; } QueryHandler parentHandler = ( this . parentSearchManager != null ) ? parentSearchManager . getHandler ( ) : null ; QueryHandlerContext context = createQueryHandlerContext ( parentHandler ) ; handler . setContext ( context ) ; if ( parentSearchManager != null ) { changesFilter = initializeChangesFilter ( ) ; parentSearchManager . setChangesFilter ( changesFilter ) ; } } catch ( SecurityException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( IllegalArgumentException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( ClassNotFoundException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( NoSuchMethodException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( InstantiationException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; } }
Initializes the query handler .