package de.ivu.elect.business.system.control;

import javax.ejb.DependsOn;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;

import de.ivu.elect.business.konfiguration.entity.ElectKonfigurationWerte;

@Startup
@DependsOn("StartupSingleton")
@Singleton
public class BackgroundServiceRestartCronTimer extends AbstractElectCronTimer {

  @Inject
  private transient BackgroundServiceDisableToggler backgroundServiceDisableToggler;

  @Override
  protected ElectKonfigurationWerte getElectKonfigurationWerte() {
    return ElectKonfigurationWerte.BACKGROUND_SERVICE_RESTART_CRON_TIMER;
  }

  @Override
  protected void timeout() {
    backgroundServiceDisableToggler.enableAllDisabled();
  }

  @Override
  public String getJobName() {
    return "BackgroundServiceRestartCronTimer";
  }
}
