Created
December 12, 2015 21:38
-
-
Save StefanHeimberg/d0616ef7c3f594204db2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://rmannibucau.wordpress.com/2015/03/10/cdi-and-startup/ | |
@ApplicationScoped | |
public class ProvisioningDataForApplicationLifecycle { | |
private final Map<String, User> users = new HashMap<>(); // + getter | |
public void init(@Observes @Initialized(ApplicationScoped.class) Object init) { | |
users.put("cdi", new User("cdi", "1.1")); | |
users.put("deltaspike", new User("deltaspike", "1.3")); | |
} | |
public void destroy(@Observes @Destroyed(ApplicationScoped.class) Object init) { | |
users.clear(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment