View Javadoc

1   /**
2    * Copyright 2005-2014 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  package org.kuali.rice.krad.service;
17  
18  import org.kuali.rice.coreservice.api.namespace.NamespaceService;
19  import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20  import org.kuali.rice.core.framework.persistence.platform.DatabasePlatform;
21  import org.kuali.rice.kns.service.BusinessObjectAuthorizationService;
22  import org.kuali.rice.krad.dao.BusinessObjectDao;
23  import org.kuali.rice.krad.dao.DocumentDao;
24  import org.kuali.rice.krad.util.OjbCollectionHelper;
25  import org.kuali.rice.krad.workflow.service.WorkflowAttributePropertyResolutionService;
26  import org.springframework.transaction.PlatformTransactionManager;
27  import org.springframework.transaction.support.TransactionTemplate;
28  
29  public class KRADServiceLocatorInternal {
30  
31      public static final String VALIDATION_COMPLETION_UTILS = "validationCompletionUtils";
32  
33      public static <T extends Object> T getService(String serviceName) {
34      	return GlobalResourceLoader.<T>getService(serviceName);
35      }
36  
37  
38      public static final String MAIL_SERVICE = "mailService";
39  
40      public static final MailService getMailService() {
41  	return (MailService) getService(MAIL_SERVICE);
42      }
43  
44      public static final String POST_PROCESSOR_SERVICE = "postProcessorService";
45  
46      public static PostProcessorService getPostProcessorService() {
47  	return (PostProcessorService) getService(POST_PROCESSOR_SERVICE);
48      }
49  
50      public static final String NAMESPACE_SERVICE = "namespaceService";
51  
52      public static NamespaceService getNamespaceService() {
53  	return (NamespaceService) getService(NAMESPACE_SERVICE);
54      }
55  
56      public static final String OJB_COLLECTION_HELPER = "ojbCollectionHelper";
57  
58      public static OjbCollectionHelper getOjbCollectionHelper() {
59  	return (OjbCollectionHelper) getService(OJB_COLLECTION_HELPER);
60      }
61  
62      public static final String TRANSACTION_MANAGER = "transactionManager";
63  
64      public static PlatformTransactionManager getTransactionManager() {
65  	return (PlatformTransactionManager) getService(TRANSACTION_MANAGER);
66      }
67  
68      public static final String TRANSACTION_TEMPLATE = "transactionTemplate";
69  
70      public static TransactionTemplate getTransactionTemplate() {
71  	return (TransactionTemplate) getService(TRANSACTION_TEMPLATE);
72      }
73  
74      public static final String INACTIVATION_BLOCKING_DISPLAY_SERVICE = "inactivationBlockingDisplayService";
75      
76      public static InactivationBlockingDisplayService getInactivationBlockingDisplayService() {
77      	return (InactivationBlockingDisplayService) getService(INACTIVATION_BLOCKING_DISPLAY_SERVICE);
78      }
79  
80      public static final String DATA_DICTIONARY_COMPONENT_PUBLISHER_SERVICE = "dataDictionaryComponentPublisherService";
81  
82      public static DataDictionaryComponentPublisherService getDataDictionaryComponentPublisherService() {
83          return getService(DATA_DICTIONARY_COMPONENT_PUBLISHER_SERVICE);
84      }
85  
86      
87      public static final String DOCUMENT_DAO = "documentDao";
88      
89      public static DocumentDao getDocumentDao() {
90          return (DocumentDao) getService(DOCUMENT_DAO);
91      }
92      
93      public static final String BUSINESS_OBJECT_DAO = "businessObjectDao";
94      
95      public static BusinessObjectDao getBusinessObjectDao() {
96          return (BusinessObjectDao) getService(BUSINESS_OBJECT_DAO);
97      }
98      
99  
100    public static final String DB_PLATFORM = "dbPlatform";
101     
102     public static DatabasePlatform getDatabasePlatform() {
103         return (DatabasePlatform) getService(DB_PLATFORM);
104     }
105     
106     public static final String MAINTENANCE_DOCUMENT_AUTHORIZATION_SERVICE = "maintenanceDocumentAuthorizationService";
107     
108     public static BusinessObjectAuthorizationService getMaintenanceDocumentAuthorizationService() {
109     	return (BusinessObjectAuthorizationService) getService(MAINTENANCE_DOCUMENT_AUTHORIZATION_SERVICE);
110     }
111 
112     public static final String WORKFLOW_ATTRIBUTE_PROPERTY_RESOLUTION_SERVICE = "workflowAttributesPropertyResolutionService";
113     
114     public static WorkflowAttributePropertyResolutionService getWorkflowAttributePropertyResolutionService() {
115     	return (WorkflowAttributePropertyResolutionService) getService(WORKFLOW_ATTRIBUTE_PROPERTY_RESOLUTION_SERVICE);
116     }
117     
118     public static final String INACTIVATEABLE_FROM_TO_SERVICE = "inactivateableFromToService";
119     
120     public static InactivateableFromToService getInactivateableFromToService() {
121     	return (InactivateableFromToService) getService(INACTIVATEABLE_FROM_TO_SERVICE);
122     }
123     
124 }