1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
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 | |
} |