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

import java.io.Serializable;

import javax.enterprise.event.Observes;
import javax.enterprise.event.Reception;
import javax.enterprise.event.TransactionPhase;
import javax.inject.Inject;

import de.ivu.elect.business.exchange.entity.ImportEvent;
import de.ivu.elect.business.personenpruefung.boundary.PersonenPruefungStarter;

public class PersonenpruefungStartenImportEventListener implements Serializable {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient PersonenPruefungStarter personenPruefungStarter;

  public void listen(
      @Observes(during = TransactionPhase.AFTER_SUCCESS, notifyObserver = Reception.ALWAYS) ImportEvent event) {
    personenPruefungStarter.startePersonenPruefung();
  }

}
