001    /**
002     * Copyright (c) 2000-2012 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 setIndexSearcher(IndexSearcher indexSearcher) {
026                    _indexSearcher = indexSearcher;
027            }
028    
029            public void setIndexWriter(IndexWriter indexWriter) {
030                    _indexWriter = indexWriter;
031            }
032    
033            public void setMessageBus(MessageBus messageBus) {
034                    _messageBus = messageBus;
035            }
036    
037            @Override
038            protected IndexSearcher getIndexSearcher() {
039                    return _indexSearcher;
040            }
041    
042            @Override
043            protected IndexWriter getIndexWriter() {
044                    return _indexWriter;
045            }
046    
047            @Override
048            protected MessageBus getMessageBus() {
049                    return _messageBus;
050            }
051    
052            @Override
053            protected ClassLoader getOperatingClassloader() {
054                    Thread currentThread = Thread.currentThread();
055    
056                    return currentThread.getContextClassLoader();
057            }
058    
059            private IndexSearcher _indexSearcher;
060            private IndexWriter _indexWriter;
061            private MessageBus _messageBus;
062    
063    }