Interface Subscriber<T extends FrameworkEvent>
- Type Parameters:
T- the subscribed toFrameworkEvent
- All Superinterfaces:
BiConsumer<T, Introspection>
A
Subscriber holds logic that will be executed when a certain FrameworkEvent is published by the framework.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(T t, Introspection introspection) Executed when the subscribed toFrameworkEvent(T) is published by the framework.Methods inherited from interface BiConsumer
andThen
-
Method Details
-
accept
Executed when the subscribed to
FrameworkEvent(T) is published by the framework.Inside this method you can always use
Introspection.accessScoped()andIntrospection.scopedGet(Property), the returnedIntrospectioninstance is the one that was used to publish the event. Thus, the stage of theIntrospectionis depending on the usedFrameworkEvent. You can take a look at the specificIntrospectionAccessannotation of anFrameworkEventclass to know which stage is available.This method will be executed in different threads, thus the logic inside needs to be threadsafe!
- Specified by:
acceptin interfaceBiConsumer<T extends FrameworkEvent, Introspection>- Parameters:
t- the publishedFrameworkEventintrospection- theIntrospectioninstance used to publish this event.
-