Class DeferredChangeEvent<E>
java.lang.Object
io.micronaut.data.jdbc.notification.DeferredChangeEvent<E>
- Type Parameters:
E- The persistent entity type.
- All Implemented Interfaces:
ChangeEvent<E>
Internal change event whose entity state is materialized by listener AOP advice immediately
before listener invocation.
A failed materialization is not cached, allowing outer retry advice to invoke the loader
again. A successful result, including a null result, is cached so a later listener
failure can be retried without reloading the entity.
-
Constructor Summary
ConstructorsConstructorDescriptionDeferredChangeEvent(ChangeOperation operation, @Nullable ChangeEventMetadata metadata, Supplier<@Nullable E> entityLoader) Creates a deferred event. -
Method Summary
Modifier and TypeMethodDescriptionentity()Returns the entity state associated with this event, when it is available.<M extends ChangeEventMetadata>
Optional<M> Finds provider-specific metadata of the requested type.Returns the operation reported by the notification provider.
-
Constructor Details
-
DeferredChangeEvent
public DeferredChangeEvent(ChangeOperation operation, @Nullable ChangeEventMetadata metadata, Supplier<@Nullable E> entityLoader) Creates a deferred event.- Parameters:
operation- The reported operation.metadata- Provider-specific event metadata.entityLoader- The entity loader invoked by the listener interceptor.
-
-
Method Details
-
operation
Description copied from interface:ChangeEventReturns the operation reported by the notification provider.- Specified by:
operationin interfaceChangeEvent<E>- Returns:
- The reported change operation.
-
entity
Description copied from interface:ChangeEventReturns the entity state associated with this event, when it is available.- Specified by:
entityin interfaceChangeEvent<E>- Returns:
- The entity, or empty when the provider has no entity state for this event.
-
metadata
Description copied from interface:ChangeEventFinds provider-specific metadata of the requested type.- Specified by:
metadatain interfaceChangeEvent<E>- Type Parameters:
M- The metadata type.- Parameters:
metadataType- The metadata type.- Returns:
- The metadata when this event contains the requested type.
-