Changeset 5183 for openmrs/branches/data_synchronization_bidirectional/src/api/org/openmrs/scheduler/SchedulerUtil.java
- Timestamp:
- 08/06/08 17:17:55 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/data_synchronization_bidirectional/src/api/org/openmrs/scheduler/SchedulerUtil.java
r4969 r5183 48 48 49 49 // TODO: do this for all services 50 Context.addProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 51 Context.getSchedulerService().onStartup(); 52 Context.removeProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 50 try { 51 Context.addProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 52 Context.getSchedulerService().onStartup(); 53 } 54 finally { 55 Context.removeProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 56 } 53 57 } 54 58 … … 68 72 69 73 // TODO: Do this for all services 70 Context.addProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 71 // doesn't attempt shutdown if there was an error getting the scheduler service 72 if (service != null) { 73 service.onShutdown(); 74 try { 75 Context.addProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 76 // doesn't attempt shutdown if there was an error getting the scheduler service 77 if (service != null) { 78 service.onShutdown(); 79 } 74 80 } 75 Context.removeProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 81 finally { 82 Context.removeProxyPrivilege(OpenmrsConstants.PRIV_MANAGE_SCHEDULER); 83 } 76 84 77 85 }