
package de.ivu.elect.jee.startup;

import javax.annotation.PostConstruct;
import javax.ejb.*;
import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Startup
@Singleton
@DependsOn("DbInit") // Bean muss existieren und im Zweifelsfall nichts machen
//https://issues.jboss.org/browse/EJBTHREE-2070 (keine Transaktion)
@TransactionManagement(TransactionManagementType.BEAN)
public class StartupSingleton {

  private static final Logger LOG = LoggerFactory.getLogger(StartupSingleton.class);

  @Inject
  private transient StartupBootstrap startup;

  @PostConstruct
  public void init() {

    LOG.info("Elect-Common - bootstrap");
    startup.startup();
    LOG.info("Elect-Common - bootstrap - done");
  }
}
