1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krad.service; |
17 | |
|
18 | |
import org.kuali.rice.core.api.config.property.ConfigurationService; |
19 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
20 | |
|
21 | |
import javax.persistence.EntityManagerFactory; |
22 | |
|
23 | 0 | public class KRADServiceLocator { |
24 | |
public static final String ATTACHMENT_SERVICE = "attachmentService"; |
25 | |
public static final String PERSISTENCE_SERVICE = "persistenceService"; |
26 | |
public static final String PERSISTENCE_STRUCTURE_SERVICE = "persistenceStructureService"; |
27 | |
public static final String NOTE_SERVICE = "noteService"; |
28 | |
public static final String BUSINESS_OBJECT_SERVICE = "businessObjectService"; |
29 | |
public static final String KUALI_CONFIGURATION_SERVICE = "kualiConfigurationService"; |
30 | |
public static final String ENTITY_MANAGER_FACTORY = "entityManagerFactory"; |
31 | |
public static final String APPLICATION_ENTITY_MANAGER_FACTORY = "kradApplicationEntityManagerFactory"; |
32 | |
public static final String XML_OBJECT_SERIALIZER_SERVICE = "xmlObjectSerializerService"; |
33 | |
public static final String SERIALIZER_SERVICE = "businessObjectSerializerService"; |
34 | |
public static final String SEQUENCE_ACCESSOR_SERVICE = "sequenceAccessorService"; |
35 | |
public static final String KEY_VALUES_SERVICE = "keyValuesService"; |
36 | |
|
37 | |
|
38 | |
static <T> T getService(String serviceName) { |
39 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
40 | |
} |
41 | |
|
42 | |
public static AttachmentService getAttachmentService() { |
43 | 0 | return getService(ATTACHMENT_SERVICE); |
44 | |
} |
45 | |
|
46 | |
public static PersistenceService getPersistenceService() { |
47 | 0 | return getService(PERSISTENCE_SERVICE); |
48 | |
} |
49 | |
|
50 | |
public static PersistenceStructureService getPersistenceStructureService() { |
51 | 0 | return getService(PERSISTENCE_STRUCTURE_SERVICE); |
52 | |
} |
53 | |
|
54 | |
public static NoteService getNoteService() { |
55 | 0 | return getService(NOTE_SERVICE); |
56 | |
} |
57 | |
|
58 | |
public static BusinessObjectService getBusinessObjectService() { |
59 | 0 | return getService(BUSINESS_OBJECT_SERVICE); |
60 | |
} |
61 | |
|
62 | |
public static ConfigurationService getKualiConfigurationService() { |
63 | 0 | return getService(KUALI_CONFIGURATION_SERVICE); |
64 | |
} |
65 | |
|
66 | |
public static EntityManagerFactory getEntityManagerFactory() { |
67 | 0 | return getService(ENTITY_MANAGER_FACTORY); |
68 | |
} |
69 | |
|
70 | |
public static EntityManagerFactory getApplicationEntityManagerFactory() { |
71 | 0 | return getService(APPLICATION_ENTITY_MANAGER_FACTORY); |
72 | |
} |
73 | |
|
74 | |
public static XmlObjectSerializerService getXmlObjectSerializerService() { |
75 | 0 | return getService(XML_OBJECT_SERIALIZER_SERVICE); |
76 | |
} |
77 | |
|
78 | |
public static BusinessObjectSerializerService getBusinessObjectSerializerService() { |
79 | 0 | return getService(SERIALIZER_SERVICE); |
80 | |
} |
81 | |
|
82 | |
public static SequenceAccessorService getSequenceAccessorService() { |
83 | 0 | return getService(SEQUENCE_ACCESSOR_SERVICE); |
84 | |
} |
85 | |
|
86 | |
public static KeyValuesService getKeyValuesService() { |
87 | 0 | return getService(KEY_VALUES_SERVICE); |
88 | |
} |
89 | |
} |