001package org.kuali.ole.docstore.discovery.service;
002
003import org.kuali.ole.docstore.indexer.solr.IndexerService;
004import org.kuali.ole.docstore.indexer.solr.WorkBibDocumentIndexer;
005
006/**
007 * Class for getting services without depending on the implementation classes.
008 * User: tirumalesh.b
009 * Date: 22/12/11 Time: 8:05 PM
010 */
011public class ServiceLocator {
012    private static IndexerService indexerService = null;
013    private static DiscoveryService discoveryService = null;
014    private static QueryService queryService = null;
015
016    public static IndexerService getIndexerService() {
017        if (null == indexerService) {
018            indexerService = WorkBibDocumentIndexer.getInstance();
019        }
020        return indexerService;
021    }
022
023    public static DiscoveryService getDiscoveryService() {
024        if (null == discoveryService) {
025            discoveryService = DiscoveryServiceImpl.getInstance();
026        }
027        return discoveryService;
028    }
029
030    public static QueryService getQueryService() {
031        if (null == queryService) {
032            queryService = QueryServiceImpl.getInstance();
033        }
034        return queryService;
035    }
036
037}