001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    /**
018     * @author Michael C. Han
019     */
020    public class DefaultSearchEngineConfigurator
021            extends AbstractSearchEngineConfigurator {
022    
023            public void setDefaultSearchEngineId(String defaultSearchEngineId) {
024                    _defaultSearchEngineId = defaultSearchEngineId;
025            }
026    
027            public void setIndexSearcher(IndexSearcher indexSearcher) {
028                    _indexSearcher = indexSearcher;
029            }
030    
031            public void setIndexWriter(IndexWriter indexWriter) {
032                    _indexWriter = indexWriter;
033            }
034    
035            @Override
036            protected String getDefaultSearchEngineId() {
037                    return _defaultSearchEngineId;
038            }
039    
040            @Override
041            protected IndexSearcher getIndexSearcher() {
042                    return _indexSearcher;
043            }
044    
045            @Override
046            protected IndexWriter getIndexWriter() {
047                    return _indexWriter;
048            }
049    
050            @Override
051            protected ClassLoader getOperatingClassloader() {
052                    Thread currentThread = Thread.currentThread();
053    
054                    return currentThread.getContextClassLoader();
055            }
056    
057            private String _defaultSearchEngineId;
058            private IndexSearcher _indexSearcher;
059            private IndexWriter _indexWriter;
060    
061    }