001    /**
002     * Copyright (c) 2000-2013 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    import com.liferay.portal.kernel.messaging.MessageBus;
018    
019    /**
020     * @author Michael C. Han
021     */
022    public class DefaultSearchEngineConfigurator
023            extends AbstractSearchEngineConfigurator {
024    
025            public void setDefaultSearchEngineId(String defaultSearchEngineId) {
026                    _defaultSearchEngineId = defaultSearchEngineId;
027            }
028    
029            public void setIndexSearcher(IndexSearcher indexSearcher) {
030                    _indexSearcher = indexSearcher;
031            }
032    
033            public void setIndexWriter(IndexWriter indexWriter) {
034                    _indexWriter = indexWriter;
035            }
036    
037            public void setMessageBus(MessageBus messageBus) {
038                    _messageBus = messageBus;
039            }
040    
041            @Override
042            protected String getDefaultSearchEngineId() {
043                    return _defaultSearchEngineId;
044            }
045    
046            @Override
047            protected IndexSearcher getIndexSearcher() {
048                    return _indexSearcher;
049            }
050    
051            @Override
052            protected IndexWriter getIndexWriter() {
053                    return _indexWriter;
054            }
055    
056            @Override
057            protected MessageBus getMessageBus() {
058                    return _messageBus;
059            }
060    
061            @Override
062            protected ClassLoader getOperatingClassloader() {
063                    Thread currentThread = Thread.currentThread();
064    
065                    return currentThread.getContextClassLoader();
066            }
067    
068            private String _defaultSearchEngineId;
069            private IndexSearcher _indexSearcher;
070            private IndexWriter _indexWriter;
071            private MessageBus _messageBus;
072    
073    }