@Override
 public synchronized void dispose() {
   stopAlertScheduling();
   super.dispose();
   _serviceManagementRecordService.dispose();
   _alertService.dispose();
   _globalInterlockService.dispose();
   _userService.dispose();
 }
  /**
   * Enables the scheduling service.
   *
   * @param enabled True to enable, false to disable.
   */
  @Transactional
  protected void _setServiceEnabled(boolean enabled) {
    synchronized (_serviceManagementRecordService) {
      ServiceManagementRecord record =
          _serviceManagementRecordService.findServiceManagementRecord(Service.SCHEDULING);

      if (record == null) {
        record =
            new ServiceManagementRecord(_userService.findAdminUser(), Service.SCHEDULING, enabled);
      }
      record.setEnabled(enabled);
      _serviceManagementRecordService.updateServiceManagementRecord(record);
    }
  }