Coverage Report - org.kuali.rice.kns.service.KNSServiceLocator
 
Classes in this File Line Coverage Branch Coverage Complexity
KNSServiceLocator
0%
0/15
N/A
1
 
 1  
 /*
 2  
  * Copyright 2006-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.rice.kns.service;
 18  
 
 19  
 import org.kuali.rice.core.api.CoreConstants;
 20  
 import org.kuali.rice.core.api.datetime.DateTimeService;
 21  
 import org.kuali.rice.core.api.config.property.ConfigurationService;
 22  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 23  
 
 24  
 import javax.persistence.EntityManagerFactory;
 25  
 
 26  0
 public class KNSServiceLocator {
 27  
     public static final String ATTACHMENT_SERVICE = "attachmentService";
 28  
     public static final String PERSISTENCE_SERVICE = "persistenceService";
 29  
     public static final String PERSISTENCE_STRUCTURE_SERVICE = "persistenceStructureService";
 30  
     public static final String NOTE_SERVICE = "noteService";
 31  
     public static final String BUSINESS_OBJECT_SERVICE = "businessObjectService";
 32  
     public static final String KUALI_CONFIGURATION_SERVICE = "kualiConfigurationService";
 33  
     public static final String ENTITY_MANAGER_FACTORY = "entityManagerFactory";
 34  
     public static final String APPLICATION_ENTITY_MANAGER_FACTORY = "knsApplicationEntityManagerFactory";
 35  
     public static final String XML_OBJECT_SERIALIZER_SERVICE = "xmlObjectSerializerService";
 36  
     public static final String SERIALIZER_SERVICE = "businessObjectSerializerService";
 37  
     public static final String SEQUENCE_ACCESSOR_SERVICE = "sequenceAccessorService";
 38  
     public static final String KEY_VALUES_SERVICE = "keyValuesService";
 39  
 
 40  
 
 41  
     static <T> T getService(String serviceName) {
 42  0
         return GlobalResourceLoader.<T>getService(serviceName);
 43  
     }
 44  
 
 45  
     public static AttachmentService getAttachmentService() {
 46  0
         return getService(ATTACHMENT_SERVICE);
 47  
     }
 48  
 
 49  
     public static PersistenceService getPersistenceService() {
 50  0
         return getService(PERSISTENCE_SERVICE);
 51  
     }
 52  
 
 53  
     public static PersistenceStructureService getPersistenceStructureService() {
 54  0
         return getService(PERSISTENCE_STRUCTURE_SERVICE);
 55  
     }
 56  
 
 57  
     public static DateTimeService getDateTimeService() {
 58  0
         return getService(CoreConstants.Services.DATETIME_SERVICE);
 59  
     }
 60  
 
 61  
     public static NoteService getNoteService() {
 62  0
         return getService(NOTE_SERVICE);
 63  
     }
 64  
 
 65  
     public static BusinessObjectService getBusinessObjectService() {
 66  0
         return getService(BUSINESS_OBJECT_SERVICE);
 67  
     }
 68  
 
 69  
     public static ConfigurationService getKualiConfigurationService() {
 70  0
         return getService(KUALI_CONFIGURATION_SERVICE);
 71  
     }
 72  
 
 73  
     public static EntityManagerFactory getEntityManagerFactory() {
 74  0
         return getService(ENTITY_MANAGER_FACTORY);
 75  
     }
 76  
 
 77  
     public static EntityManagerFactory getApplicationEntityManagerFactory() {
 78  0
         return getService(APPLICATION_ENTITY_MANAGER_FACTORY);
 79  
     }
 80  
 
 81  
     public static XmlObjectSerializerService getXmlObjectSerializerService() {
 82  0
         return getService(XML_OBJECT_SERIALIZER_SERVICE);
 83  
     }
 84  
 
 85  
     public static BusinessObjectSerializerService getBusinessObjectSerializerService() {
 86  0
         return getService(SERIALIZER_SERVICE);
 87  
     }
 88  
 
 89  
     public static SequenceAccessorService getSequenceAccessorService() {
 90  0
         return getService(SEQUENCE_ACCESSOR_SERVICE);
 91  
     }
 92  
 
 93  
     public static KeyValuesService getKeyValuesService() {
 94  0
         return getService(KEY_VALUES_SERVICE);
 95  
     }
 96  
 }