package de.ivu.elect.business.praesentation.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.konfiguration.entity.ElectKonfigurationWerte;
import de.ivu.elect.business.konfiguration.entity.KonfigurationWertGeaendertEvent;

public class PresentationServletStatusKonfigurationGeaendertListener implements Serializable {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient PraesentationStaticResourceServletSecurity praesentationStaticResourceServletSecurity;

  public void listen(@Observes(during = TransactionPhase.AFTER_COMPLETION, notifyObserver = Reception.ALWAYS) KonfigurationWertGeaendertEvent konfigurationWertGeaendertEvent) {
    if (ElectKonfigurationWerte.PRAESENTATION_SERVLET_STATUS.equals(konfigurationWertGeaendertEvent.getKey())) {
      praesentationStaticResourceServletSecurity.init();
    }
  }
}
