View Javadoc
1   package org.kuali.ole.docstore.discovery.service;
2   
3   import org.kuali.ole.docstore.indexer.solr.IndexerService;
4   import org.kuali.ole.docstore.indexer.solr.WorkBibDocumentIndexer;
5   
6   /**
7    * Class for getting services without depending on the implementation classes.
8    * User: tirumalesh.b
9    * Date: 22/12/11 Time: 8:05 PM
10   */
11  public class ServiceLocator {
12      private static IndexerService indexerService = null;
13      private static DiscoveryService discoveryService = null;
14      private static QueryService queryService = null;
15  
16      public static IndexerService getIndexerService() {
17          if (null == indexerService) {
18              indexerService = WorkBibDocumentIndexer.getInstance();
19          }
20          return indexerService;
21      }
22  
23      public static DiscoveryService getDiscoveryService() {
24          if (null == discoveryService) {
25              discoveryService = DiscoveryServiceImpl.getInstance();
26          }
27          return discoveryService;
28      }
29  
30      public static QueryService getQueryService() {
31          if (null == queryService) {
32              queryService = QueryServiceImpl.getInstance();
33          }
34          return queryService;
35      }
36  
37  }