Class AbstractEventSourceInterceptor
java.lang.Object
io.micronaut.coherence.data.interceptors.AbstractEventSourceInterceptor
- All Implemented Interfaces:
io.micronaut.aop.Interceptor,io.micronaut.aop.MethodInterceptor,io.micronaut.core.order.Ordered
- Direct Known Subclasses:
AbstractAsyncEventSourceInterceptor,PersistEventSourceInterceptor,RemoveEventSourceInterceptor,UpdateEventSourceInterceptor
public abstract class AbstractEventSourceInterceptor
extends Object
implements io.micronaut.aop.MethodInterceptor
Base class for sync event source interceptors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the logical operations for multiple event types (i.e., pre, post persist).static enumVarious entity event types used by Micronaut Data. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.micronaut.data.model.runtime.RuntimeEntityRegistryRuntimeEntityRegistryused for event notification.Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGETFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEventSourceInterceptor(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry) Constructs a new AbstractEventSourceInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionReturn theEventGrouphandled by this interceptor.Return thePOSTevent type this interceptor wishes to emit.Return thePREevent type this interceptor wishes to emit.intercept(io.micronaut.aop.MethodInvocationContext context) protected booleantrigger(AbstractEventSourceInterceptor.EventType eventType, Object entity) Trigger the specified event using the provided entity as the event value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.aop.MethodInterceptor
interceptMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Field Details
-
registry
protected final io.micronaut.data.model.runtime.RuntimeEntityRegistry registryRuntimeEntityRegistryused for event notification.
-
-
Constructor Details
-
AbstractEventSourceInterceptor
protected AbstractEventSourceInterceptor(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry) Constructs a new AbstractEventSourceInterceptor.- Parameters:
registry- theRuntimeEntityRegistry
-
-
Method Details
-
intercept
- Specified by:
interceptin interfaceio.micronaut.aop.MethodInterceptor
-
getEventGroup
Return theEventGrouphandled by this interceptor.- Returns:
- the
EventGrouphandled by this interceptor
-
getHandledPreEventType
Return thePREevent type this interceptor wishes to emit.- Returns:
- the
PREevent type this interceptor wishes to emit
-
getHandledPostEventType
Return thePOSTevent type this interceptor wishes to emit.- Returns:
- the
POSTevent type this interceptor wishes to emit
-
trigger
Trigger the specified event using the provided entity as the event value.- Parameters:
eventType- theAbstractEventSourceInterceptor.EventTypeentity- the event value- Returns:
- the result of any
PREevents may be inspected to stop processing of an event. Any values returned forPOSTevents is meaningless.
-