
package de.ivu.elect.business.wahl.boundary;

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

import de.ivu.elect.business.wahl.entity.Wahl;
import de.ivu.elect.jee.security.LogoutChangeEvent;

public class SetzeWahlLogoutChangeListener {

  @Inject
  private WahlSessionSelect wahlSelect;

  public void onLogoutChanged(@Observes LogoutChangeEvent event) {
    clearWahlSelect();
  }

  private void clearWahlSelect() {
    setWahl(null);
  }

  protected void setWahl(Wahl wahl) {
    wahlSelect.setEntity(wahl);
  }

}
