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

import java.io.Serializable;

import javax.ejb.EJB;
import javax.enterprise.event.Observes;
import javax.enterprise.event.Reception;
import javax.enterprise.event.TransactionPhase;

import de.ivu.elect.business.mandant.boundary.MandantPostCreateEvent;
import de.ivu.elect.business.system.control.SystemStatusCheckPostStartupAsync;

public class MandantPostCreateEventListener implements Serializable {

  private static final long serialVersionUID = 1L;

  @EJB
  protected SystemStatusCheckPostStartupAsync systemStatusCheckPostStartupAsync;

  public void listen(
      @Observes(during = TransactionPhase.AFTER_SUCCESS, notifyObserver = Reception.ALWAYS) MandantPostCreateEvent event) {
    systemStatusCheckPostStartupAsync.checkMandant(event.getEntity());
  }

}
