Implemented by a bean that wants the event publisher handed to it through a method call.
The usual way is to inject ApplicationEventPublisher through the
constructor; this callback exists for beans that cannot.
// Publishes an event for every order it handles.
@Service()
class Orders implements ApplicationEventPublisherAware {
late ApplicationEventPublisher events;
@override
void setApplicationEventPublisher(ApplicationEventPublisher p) =>
events = p;
}
Spring (Java):
@Service
class Orders implements ApplicationEventPublisherAware {
public void setApplicationEventPublisher(
ApplicationEventPublisher publisher) { ... }
}
- Implemented types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setApplicationEventPublisher(
ApplicationEventPublisher publisher) → void - Receives the context, which is the event publisher; called once, after injection and before the init callbacks.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited