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