001    /**
002     * Copyright 2004-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.hr.time.service.base;
017    
018    import org.kuali.hr.core.notification.service.KPMENotificationService;
019    import org.kuali.hr.job.service.JobService;
020    import org.kuali.hr.lm.accrual.service.AccrualCategoryMaxBalanceService;
021    import org.kuali.hr.lm.accrual.service.AccrualCategoryMaxCarryOverService;
022    import org.kuali.hr.lm.accrual.service.AccrualCategoryRuleService;
023    import org.kuali.hr.lm.accrual.service.AccrualCategoryService;
024    import org.kuali.hr.lm.accrual.service.AccrualService;
025    import org.kuali.hr.lm.accrual.service.PrincipalAccrualRanService;
026    import org.kuali.hr.lm.balancetransfer.service.BalanceTransferService;
027    import org.kuali.hr.lm.leavepayout.service.LeavePayoutService;
028    import org.kuali.hr.lm.earncodesec.service.EarnCodeSecurityService;
029    import org.kuali.hr.lm.employeeoverride.service.EmployeeOverrideService;
030    import org.kuali.hr.lm.leave.approval.service.LeaveApprovalService;
031    import org.kuali.hr.lm.leaveSummary.service.LeaveSummaryService;
032    import org.kuali.hr.lm.leaveadjustment.service.LeaveAdjustmentService;
033    import org.kuali.hr.lm.leaveblock.service.LeaveBlockHistoryService;
034    import org.kuali.hr.lm.leaveblock.service.LeaveBlockService;
035    import org.kuali.hr.lm.leavecalendar.service.LeaveCalendarService;
036    import org.kuali.hr.lm.leavedonation.service.LeaveDonationService;
037    import org.kuali.hr.lm.leaveplan.service.LeavePlanService;
038    import org.kuali.hr.lm.leaverequest.service.LeaveRequestDocumentService;
039    import org.kuali.hr.lm.timeoff.service.SystemScheduledTimeOffService;
040    import org.kuali.hr.lm.workflow.service.LeaveCalendarDocumentHeaderService;
041    import org.kuali.hr.location.service.LocationService;
042    import org.kuali.hr.paygrade.service.PayGradeService; 
043    import org.kuali.hr.time.approval.service.TimeApproveService;
044    import org.kuali.hr.time.assignment.dao.AssignmentDao;
045    import org.kuali.hr.time.assignment.service.AssignmentService;
046    import org.kuali.hr.time.batch.service.BatchJobService;
047    import org.kuali.hr.time.calendar.service.CalendarEntriesService;
048    import org.kuali.hr.time.calendar.service.CalendarService;
049    import org.kuali.hr.time.clock.location.service.ClockLocationRuleService;
050    import org.kuali.hr.time.clocklog.service.ClockLogService;
051    import org.kuali.hr.time.department.service.DepartmentService;
052    import org.kuali.hr.time.dept.lunch.service.DepartmentLunchRuleService;
053    import org.kuali.hr.time.docsearch.TkSearchableAttributeService;
054    import org.kuali.hr.time.earncode.service.EarnCodeService;
055    import org.kuali.hr.time.earncodegroup.service.EarnCodeGroupService;
056    import org.kuali.hr.time.graceperiod.service.GracePeriodService;
057    import org.kuali.hr.time.missedpunch.service.MissedPunchService;
058    import org.kuali.hr.time.overtime.daily.rule.service.DailyOvertimeRuleService;
059    import org.kuali.hr.time.overtime.weekly.rule.service.WeeklyOvertimeRuleService;
060    import org.kuali.hr.time.paytype.service.PayTypeService;
061    import org.kuali.hr.time.permissions.TkPermissionsService;
062    import org.kuali.hr.time.position.service.PositionService;
063    import org.kuali.hr.time.principal.service.PrincipalHRAttributesService;
064    import org.kuali.hr.time.roles.service.TkRoleGroupService;
065    import org.kuali.hr.time.roles.service.TkRoleService;
066    import org.kuali.hr.time.rule.TkRuleControllerService;
067    import org.kuali.hr.time.salgroup.service.SalGroupService;
068    import org.kuali.hr.time.shiftdiff.rule.service.ShiftDifferentialRuleService;
069    import org.kuali.hr.time.syslunch.service.SystemLunchRuleService;
070    import org.kuali.hr.time.task.service.TaskService;
071    import org.kuali.hr.time.timeblock.service.TimeBlockHistoryDetailService;
072    import org.kuali.hr.time.timeblock.service.TimeBlockHistoryService;
073    import org.kuali.hr.time.timeblock.service.TimeBlockService;
074    import org.kuali.hr.time.timecollection.rule.service.TimeCollectionRuleService;
075    import org.kuali.hr.time.timehourdetail.service.TimeHourDetailService;
076    import org.kuali.hr.time.timesheet.service.TimesheetService;
077    import org.kuali.hr.time.timesummary.service.TimeSummaryService;
078    import org.kuali.hr.time.timezone.service.TimezoneService;
079    import org.kuali.hr.time.user.pref.service.UserPreferenceService;
080    import org.kuali.hr.time.warning.TkWarningService;
081    import org.kuali.hr.time.workarea.service.WorkAreaService;
082    import org.kuali.hr.time.workflow.service.TimesheetDocumentHeaderService;
083    import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
084    import org.kuali.rice.core.impl.cache.DistributedCacheManagerDecorator;
085    import org.springframework.beans.BeansException;
086    import org.springframework.context.ApplicationContext;
087    import org.springframework.context.ApplicationContextAware;
088    import org.springframework.jdbc.core.JdbcTemplate;
089    import org.springframework.transaction.PlatformTransactionManager;
090    import org.springframework.transaction.support.TransactionTemplate;
091    import org.springmodules.orm.ojb.PersistenceBrokerTemplate;
092    
093    public class TkServiceLocator implements ApplicationContextAware {
094            public static String SPRING_BEANS = "classpath:SpringBeans.xml";
095            private static ApplicationContext CONTEXT;
096            public static final String TK_PERMISSIONS_SERVICE = "permissionsService";
097            public static final String TK_CLOCK_LOG_SERVICE = "clockLogService";
098            public static final String TK_ASSIGNMENT_SERVICE = "assignmentService";
099            public static final String TK_ASSIGNMENT_DAO     = "assignmentDao";
100            public static final String TK_TIME_BLOCK_SERVICE = "timeBlockService";
101            public static final String TK_TIME_BLOCK_HISTORY_SERVICE = "timeBlockHistoryService";
102            public static final String TK_TIME_BLOCK_HISTORY_DETAIL_SERVICE = "timeBlockHistoryDetailService";
103            public static final String TK_JOB_SERVICE = "jobService";
104            public static final String TK_PAY_TYPE_SERVICE = "payTypeService";
105            public static final String TK_PAY_CALENDAR_SERVICE = "calendarService";
106            public static final String TK_PAY_CALENDAR_ENTRIES_SERVICE = "calendarEntriesService";
107            public static final String TK_PERSISTENCE_BROKER_TEMPLATE = "tkPersistenceBrokerTemplate";
108            public static final String TK_CACHE_MANAGER_SERVICE = "cacheManager";
109            public static final String TK_WORK_AREA_SERVICE = "workAreaService";
110            public static final String TK_TIMESHEET_SERVICE = "timesheetService";
111            public static final String TK_TIMESHEET_DOCUMENT_HEADER_SERVICE = "timesheetDocumentHeaderService";
112            public static final String TK_DEPARTMENT_SERVICE = "departmentService";
113            public static final String TK_EARN_CODE_SECURITY = "earnCodeSecurityService";
114            public static final String TK_EARN_CODE = "earnCodeService";
115            public static final String TK_TIME_COLLECTION_RULE_SERVICE = "timeCollectionRuleService";
116            public static final String TK_ROLE_SERVICE = "tkRoleService";
117            public static final String TK_ROLE_GROUP_SERVICE = "tkRoleGroupService";
118            public static final String TK_TIME_SUMMARY_SERVICE = "timeSummaryService";
119            public static final String TK_TIME_EARN_CODE_GROUP_SERVICE = "earnCodeGroupService";
120            public static final String TK_TIME_HOUR_DETAIL_SERVICE= "timeHourDetailService";
121            public static final String TK_DAILY_OVERTIME_RULE_SERVICE = "dailyOvertimeRuleService";
122            public static final String TK_WEEKLY_OVERTIME_RULE_SERVICE = "weeklyOvertimeRuleService";
123            public static final String TK_SHIFT_DIFFERENTIAL_RULE_SERVICE = "shiftDifferentialRuleService";
124            public static final String TK_CLOCK_LOCATION_RULE_SERVICE = "clockLocationService";
125            public static final String TK_GRACE_PERIOD_SERVICE = "gracePeriodService";
126            public static final String TK_SYSTEM_LUNCH_RULE_SERVICE = "systemLunchRuleService";
127            public static final String TK_DEPT_LUNCH_RULE_SERVICE = "deptLunchRuleService";
128            public static final String TK_PRINCIPAL_CALENDAR_SERVICE = "principalCalendarService";
129            public static final String TK_USER_PREF_SERVICE = "userPrefService";
130            public static final String TK_TIME_ZONE_SERVICE = "timezoneService";
131            public static final String TK_TIME_OFF_ACCRUAL_SERVICE = "timeOffAccrualService";
132            public static final String hr_sal_group_SERVICE = "salGroupService";
133            public static final String TK_ACCRUAL_CATEGORY_SERVICE = "accrualCategoryService";
134            public static final String TK_ACCRUAL_CATEGORY_RULE_SERVICE = "accrualCategoryRuleService";
135        public static final String TK_TASK_SERVICE = "taskService";
136        public static final String TK_LOCATION_SERVICE = "locationService";
137        public static final String TK_PAY_GRADE_SERVICE = "payGradeService";
138        public static final String TK_APPROVE_SERVICE = "timeApproveService";
139        public static final String TK_BATCH_JOB_SERVICE = "batchJobService";
140        public static final String TK_MISSED_PUNCH_SERVICE = "missedPunchService";
141        public static final String TK_BATCH_JOB_ENTRY_SERVICE = "batchJobEntryService";
142        public static final String TK_WARNINGS_SERVICE = "tkWarningService";
143        public static final String HR_POSITION_SERVICE = "positionService";
144        public static final String TK_SEARCH_ATTR_SERVICE = "tkSearchableAttributeService";
145        public static final String LM_ACCRUAL_SERVICE = "accrualService";
146        public static final String LM_ACCRUAL_CATEGORY_SERVICE = "leaveAccrualCategoryService";
147        public static final String LM_LEAVE_PLAN_SERVICE = "leavePlanService";
148        public static final String LM_LEAVE_DONATION_SERVICE = "leaveDonationService";
149        public static final String LM_SYS_SCH_TIMEOFF_SERVICE = "systemScheduledTimeOffService";
150        public static final String LM_LEAVE_BLOCK_SERVICE = "leaveBlockService";
151        public static final String LM_LEAVE_CALENDAR_SERVICE = "leaveCalendarService";
152        public static final String LM_LEAVE_CALENDAR_DOCUMENT_HEADER_SERVICE = "leaveCalendarDocumentHeaderService";
153        public static final String LM_EMPLOYEE_OVERRIDE_SERVICE = "employeeOverrideService";
154            public static final String TK_PRINCIPAL_HR_ATTRIBUTES_SERVICE = "principalHRAttributesService";
155            public static final String LM_LEAVE_ADJUSTMENT_SERVICE = "leaveAdjustmentService";
156            public static final String LM_LEAVE_BLOCK_HISTORY_SERVICE = "leaveBlockHistoryService";
157            public static final String LM_PRINCIPAL_ACCRUAL_RAN_SERVICE = "principalAccrualRanService";
158            public static final String LM_LEAVE_SUMMARY_SERVICE = "leaveSummaryService";
159            public static final String LM_LEAVE_APPROVAL_SERVICE = "leaveApprovalService";
160        public static final String LM_BALANCE_TRANSFER_SERVICE = "balanceTransferService";
161        public static final String LM_ACCRUAL_CATEGORY_MAX_BALANCE_SERVICE = "accrualCategoryMaxBalanceService";
162        public static final String LM_LEAVE_REQUEST_DOC_SERVICE = "leaveRequestDocumentService";
163            public static final String LM_ACCRUAL_CATEGORY_MAX_CARRY_OVER_SERVICE = "accrualCategoryMaxCarryOverService";
164        public static final String LM_LEAVE_PAYOUT_SERVICE = "leavePayoutService";
165            public static final String KPME_DISTRIBUTED_CACHE_MANAGER = "kpmeDistributedCacheManager";
166        public static final String KPME_NOTIFICATION_SERVICE = "kpmeNotificationService";
167        
168        public static MissedPunchService getMissedPunchService() {
169            return (MissedPunchService) CONTEXT.getBean(TK_MISSED_PUNCH_SERVICE);
170        }
171    
172        public static TaskService getTaskService() {
173            return (TaskService) CONTEXT.getBean(TK_TASK_SERVICE);
174        }
175    
176            public static SalGroupService getSalGroupService() {
177                    return (SalGroupService) CONTEXT.getBean(hr_sal_group_SERVICE);
178            }
179    
180            public static DepartmentService getDepartmentService() {
181                    return (DepartmentService) CONTEXT.getBean(TK_DEPARTMENT_SERVICE);
182            }
183    
184            public static ShiftDifferentialRuleService getShiftDifferentialRuleService() {
185                    return (ShiftDifferentialRuleService) CONTEXT.getBean(TK_SHIFT_DIFFERENTIAL_RULE_SERVICE);
186            }
187    
188            public static WeeklyOvertimeRuleService getWeeklyOvertimeRuleService() {
189                    return (WeeklyOvertimeRuleService) CONTEXT.getBean(TK_WEEKLY_OVERTIME_RULE_SERVICE);
190            }
191    
192            public static DailyOvertimeRuleService getDailyOvertimeRuleService() {
193                    return (DailyOvertimeRuleService) CONTEXT.getBean(TK_DAILY_OVERTIME_RULE_SERVICE);
194            }
195    
196            public static TkRoleService getTkRoleService() {
197                    return (TkRoleService) CONTEXT.getBean(TK_ROLE_SERVICE);
198            }
199    
200            public static TkRoleGroupService getTkRoleGroupService() {
201                    return (TkRoleGroupService) CONTEXT.getBean(TK_ROLE_GROUP_SERVICE);
202            }
203            
204            public static TimesheetDocumentHeaderService getTimesheetDocumentHeaderService() {
205                    return (TimesheetDocumentHeaderService) CONTEXT.getBean(TK_TIMESHEET_DOCUMENT_HEADER_SERVICE);
206            }
207    
208            public static TimesheetService getTimesheetService() {
209                    return (TimesheetService) CONTEXT.getBean(TK_TIMESHEET_SERVICE);
210            }
211    
212            public static WorkAreaService getWorkAreaService() {
213                return (WorkAreaService)CONTEXT.getBean(TK_WORK_AREA_SERVICE);
214            }
215    
216            public static ClockLogService getClockLogService(){
217                return (ClockLogService)CONTEXT.getBean(TK_CLOCK_LOG_SERVICE);
218            }
219            
220            public static TkPermissionsService getPermissionsService(){
221                return (TkPermissionsService)CONTEXT.getBean(TK_PERMISSIONS_SERVICE);
222            }
223    
224        public static DistributedCacheManagerDecorator getDistributedCacheManager() {
225            return (DistributedCacheManagerDecorator)CONTEXT.getBean(KPME_DISTRIBUTED_CACHE_MANAGER);
226        }
227    
228    
229    
230    
231            public static AssignmentService getAssignmentService(){
232                return (AssignmentService)CONTEXT.getBean(TK_ASSIGNMENT_SERVICE);
233            }
234    
235            public static TimeBlockService getTimeBlockService(){
236                    return (TimeBlockService)CONTEXT.getBean(TK_TIME_BLOCK_SERVICE);
237            }
238    
239            public static TimeBlockHistoryService getTimeBlockHistoryService(){
240                    return (TimeBlockHistoryService)CONTEXT.getBean(TK_TIME_BLOCK_HISTORY_SERVICE);
241            }
242            
243            public static TimeBlockHistoryDetailService getTimeBlockHistoryDetailService(){
244                    return (TimeBlockHistoryDetailService)CONTEXT.getBean(TK_TIME_BLOCK_HISTORY_DETAIL_SERVICE);
245            }
246    
247            public static AssignmentDao getAssignmentDao() {
248                return (AssignmentDao)CONTEXT.getBean(TK_ASSIGNMENT_DAO);
249            }
250    
251            public static JobService getJobService() {
252                    return (JobService)CONTEXT.getBean(TK_JOB_SERVICE);
253            }
254    
255            public static PayTypeService getPayTypeService() {
256                    return (PayTypeService)CONTEXT.getBean(TK_PAY_TYPE_SERVICE);
257            }
258    
259            public static PersistenceBrokerTemplate getTkPersistenceBrokerTemplate() {
260                return (PersistenceBrokerTemplate) CONTEXT.getBean(TK_PERSISTENCE_BROKER_TEMPLATE);
261            }
262    
263            public static TkRuleControllerService getTkRuleControllerService(){
264                    return (TkRuleControllerService) CONTEXT.getBean("tkRuleControllerService");
265            }
266    
267            public static EarnCodeSecurityService getEarnCodeSecurityService() {
268                    return (EarnCodeSecurityService) CONTEXT.getBean(TK_EARN_CODE_SECURITY);
269            }
270    
271            public static EarnCodeService getEarnCodeService() {
272                    return (EarnCodeService) CONTEXT.getBean(TK_EARN_CODE);
273            }
274    
275            public static TimeCollectionRuleService getTimeCollectionRuleService() {
276                    return (TimeCollectionRuleService) CONTEXT.getBean(TK_TIME_COLLECTION_RULE_SERVICE);
277            }
278    
279            public static TimeSummaryService getTimeSummaryService(){
280                    return (TimeSummaryService) CONTEXT.getBean(TK_TIME_SUMMARY_SERVICE);
281            }
282    
283            public static EarnCodeGroupService getEarnCodeGroupService(){
284                    return (EarnCodeGroupService) CONTEXT.getBean(TK_TIME_EARN_CODE_GROUP_SERVICE);
285            }
286    
287            public static TimeHourDetailService getTimeHourDetailService(){
288                    return (TimeHourDetailService) CONTEXT.getBean(TK_TIME_HOUR_DETAIL_SERVICE);
289            }
290    
291            public static ClockLocationRuleService getClockLocationRuleService(){
292                    return (ClockLocationRuleService) CONTEXT.getBean(TK_CLOCK_LOCATION_RULE_SERVICE);
293            }
294    
295            public static GracePeriodService getGracePeriodService(){
296                    return (GracePeriodService) CONTEXT.getBean(TK_GRACE_PERIOD_SERVICE);
297            }
298    
299            public static SystemLunchRuleService getSystemLunchRuleService(){
300                    return (SystemLunchRuleService) CONTEXT.getBean(TK_SYSTEM_LUNCH_RULE_SERVICE);
301            }
302    
303            public static DepartmentLunchRuleService getDepartmentLunchRuleService(){
304                    return (DepartmentLunchRuleService) CONTEXT.getBean(TK_DEPT_LUNCH_RULE_SERVICE);
305            }
306    
307            public static UserPreferenceService getUserPreferenceService(){
308                    return (UserPreferenceService) CONTEXT.getBean(TK_USER_PREF_SERVICE);
309            }
310    
311            public static TimezoneService getTimezoneService(){
312                    return (TimezoneService) CONTEXT.getBean(TK_TIME_ZONE_SERVICE);
313            }
314    
315            public static AccrualCategoryService getAccrualCategoryService() {
316                return (AccrualCategoryService)CONTEXT.getBean(TK_ACCRUAL_CATEGORY_SERVICE);
317            }
318            
319            public static AccrualService getAccrualService() {
320                return (AccrualService)CONTEXT.getBean(LM_ACCRUAL_SERVICE);
321            }
322            
323            public static AccrualCategoryRuleService getAccrualCategoryRuleService() {
324                return (AccrualCategoryRuleService)CONTEXT.getBean(TK_ACCRUAL_CATEGORY_RULE_SERVICE);
325            }
326            
327            public static LocationService getLocationService() {
328                return (LocationService)CONTEXT.getBean(TK_LOCATION_SERVICE);
329            }
330    
331            public static PayGradeService getPayGradeService() {
332                return (PayGradeService)CONTEXT.getBean(TK_PAY_GRADE_SERVICE);
333            }
334    
335            public static TimeApproveService getTimeApproveService(){
336                    return (TimeApproveService)CONTEXT.getBean(TK_APPROVE_SERVICE);
337            }
338    
339            public static BatchJobService getBatchJobService(){
340                    return (BatchJobService)CONTEXT.getBean(TK_BATCH_JOB_SERVICE);
341            }
342    
343            public static TkWarningService getWarningService(){
344                    return (TkWarningService) CONTEXT.getBean(TK_WARNINGS_SERVICE);
345            }
346            
347            public static PositionService getPositionService(){
348                    return (PositionService) CONTEXT.getBean(HR_POSITION_SERVICE);
349            }
350            
351            public static TkSearchableAttributeService getTkSearchableAttributeService(){
352                    return (TkSearchableAttributeService) CONTEXT.getBean(TK_SEARCH_ATTR_SERVICE);
353            }
354    
355            public static PlatformTransactionManager getPlatformTransactionManager() {
356                    return (PlatformTransactionManager)CONTEXT.getBean("transactionManager");
357            }
358    
359            public static TransactionTemplate getTransactionTemplate() {
360                    return new TransactionTemplate(getPlatformTransactionManager());
361            }
362            
363            public static AccrualService getLeaveAccrualService(){
364                    return (AccrualService) CONTEXT.getBean(LM_ACCRUAL_SERVICE);
365            }
366            
367            public static AccrualCategoryService getLeaveAccrualCategoryService(){
368                    return (AccrualCategoryService)CONTEXT.getBean(LM_ACCRUAL_CATEGORY_SERVICE);
369            }
370            
371            public static LeavePlanService getLeavePlanService(){
372                    return (LeavePlanService)CONTEXT.getBean(LM_LEAVE_PLAN_SERVICE);
373            }
374            
375            /*public static AccrualCategoryRuleService getLeaveAccrualCategoryRuleService(){
376                    return (AccrualCategoryRuleService)CONTEXT.getBean(LM_ACCRUAL_CATEGORY_RULE_SERVICE);
377            }*/
378            
379            public static LeaveDonationService getLeaveDonationService(){
380                    return (LeaveDonationService)CONTEXT.getBean(LM_LEAVE_DONATION_SERVICE);
381            }
382            
383            public static SystemScheduledTimeOffService getSysSchTimeOffService(){
384                    return (SystemScheduledTimeOffService)CONTEXT.getBean(LM_SYS_SCH_TIMEOFF_SERVICE);
385            }
386    
387        public static LeaveBlockService getLeaveBlockService(){
388                    return (LeaveBlockService)CONTEXT.getBean(LM_LEAVE_BLOCK_SERVICE);
389            }
390    
391        public static LeaveBlockHistoryService getLeaveBlockHistoryService(){
392                    return (LeaveBlockHistoryService)CONTEXT.getBean(LM_LEAVE_BLOCK_HISTORY_SERVICE);
393            }
394        
395        public static LeaveCalendarService getLeaveCalendarService(){
396                    return (LeaveCalendarService)CONTEXT.getBean(LM_LEAVE_CALENDAR_SERVICE);
397            }
398    
399        public static LeaveCalendarDocumentHeaderService getLeaveCalendarDocumentHeaderService(){
400                    return (LeaveCalendarDocumentHeaderService)CONTEXT.getBean(LM_LEAVE_CALENDAR_DOCUMENT_HEADER_SERVICE);
401            }
402        
403        public static EmployeeOverrideService getEmployeeOverrideService(){
404                    return (EmployeeOverrideService)CONTEXT.getBean(LM_EMPLOYEE_OVERRIDE_SERVICE);
405            }
406        
407        public static LeaveAdjustmentService getLeaveAdjustmentService(){
408                    return (LeaveAdjustmentService)CONTEXT.getBean(LM_LEAVE_ADJUSTMENT_SERVICE);
409            }
410        
411        public static PrincipalHRAttributesService getPrincipalHRAttributeService(){
412            return (PrincipalHRAttributesService)CONTEXT.getBean(TK_PRINCIPAL_HR_ATTRIBUTES_SERVICE);
413        }
414        
415            public static CalendarService getCalendarService() {
416                    return (CalendarService)CONTEXT.getBean(TK_PAY_CALENDAR_SERVICE);
417            }
418            
419            public static CalendarEntriesService getCalendarEntriesService() {
420                    return (CalendarEntriesService)CONTEXT.getBean(TK_PAY_CALENDAR_ENTRIES_SERVICE);
421            }
422            
423            public static PrincipalAccrualRanService getPrincipalAccrualRanService() {
424                    return (PrincipalAccrualRanService)CONTEXT.getBean(LM_PRINCIPAL_ACCRUAL_RAN_SERVICE);
425            }
426            public static LeaveSummaryService getLeaveSummaryService() {
427                    return (LeaveSummaryService)CONTEXT.getBean(LM_LEAVE_SUMMARY_SERVICE);
428            }
429            public static LeaveApprovalService getLeaveApprovalService() {
430                    return (LeaveApprovalService)CONTEXT.getBean(LM_LEAVE_APPROVAL_SERVICE);
431            }
432        public static BalanceTransferService getBalanceTransferService() {
433            return (BalanceTransferService) CONTEXT.getBean(LM_BALANCE_TRANSFER_SERVICE);
434        }
435        public static AccrualCategoryMaxBalanceService getAccrualCategoryMaxBalanceService() {
436            return (AccrualCategoryMaxBalanceService) CONTEXT.getBean(LM_ACCRUAL_CATEGORY_MAX_BALANCE_SERVICE);
437        }
438        public static LeavePayoutService getLeavePayoutService() {
439            return (LeavePayoutService) CONTEXT.getBean(LM_LEAVE_PAYOUT_SERVICE);
440        }
441        public static KPMENotificationService getKPMENotificationService() {
442            return (KPMENotificationService) CONTEXT.getBean(KPME_NOTIFICATION_SERVICE);
443        }
444        public static LeaveRequestDocumentService getLeaveRequestDocumentService() {
445            return (LeaveRequestDocumentService) CONTEXT.getBean(LM_LEAVE_REQUEST_DOC_SERVICE);
446        }
447        public static AccrualCategoryMaxCarryOverService getAccrualCategoryMaxCarryOverService() {
448            return (AccrualCategoryMaxCarryOverService) CONTEXT.getBean(LM_ACCRUAL_CATEGORY_MAX_CARRY_OVER_SERVICE);
449        }
450            
451            @Override
452            public void setApplicationContext(ApplicationContext arg0) throws BeansException {
453                CONTEXT = arg0;
454            }
455    
456        public static Object getBean(String beanName) {
457            return CONTEXT.getBean(beanName);
458        }
459            
460    
461        /**
462         * This is for the approval only
463         */
464        public static JdbcTemplate getTkJdbcTemplate() {
465                    return (JdbcTemplate) CONTEXT.getBean("tkJdbcTemplate");
466            }
467        
468        public static JdbcTemplate getRiceJdbcTemplate() {
469                    return (JdbcTemplate) CONTEXT.getBean("riceJdbcTemplate");
470            }
471    }