Package com.codingchili.core.context
Class StartupListener
java.lang.Object
com.codingchili.core.context.StartupListener
Allows a subscriber to wait for the application context to become available.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
publish(CoreContext core)
Calls all listeners once and removes them as listeners.static void
subscribe(Consumer<CoreContext> listener)
Adds a subcriber that will be notified when the application context is loaded.
-
Constructor Details
-
StartupListener
public StartupListener()
-
-
Method Details
-
subscribe
Adds a subcriber that will be notified when the application context is loaded.- Parameters:
listener
- called on load or if already loaded.
-
publish
Calls all listeners once and removes them as listeners.- Parameters:
core
- the application context that was loaded.
-