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