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 java.lang.Object implements io.micronaut.aop.MethodInterceptorBase class for sync event source interceptors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractEventSourceInterceptor.EventGroupRepresents the logical operations for multiple event types (i.e., pre, post persist).static classAbstractEventSourceInterceptor.EventTypeVarious entity event types used by Micronaut Data.
-
Field Summary
Fields Modifier and Type Field Description protected io.micronaut.data.model.runtime.RuntimeEntityRegistryregistryRuntimeEntityRegistryused for event notification.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEventSourceInterceptor(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry)Constructs a new AbstractEventSourceInterceptor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractEventSourceInterceptor.EventGroupgetEventGroup()Return theEventGrouphandled by this interceptor.abstract AbstractEventSourceInterceptor.EventTypegetHandledPostEventType()Return thePOSTevent type this interceptor wishes to emit.abstract AbstractEventSourceInterceptor.EventTypegetHandledPreEventType()Return thePREevent type this interceptor wishes to emit.java.lang.Objectintercept(io.micronaut.aop.MethodInvocationContext context)protected booleantrigger(AbstractEventSourceInterceptor.EventType eventType, java.lang.Object entity)Trigger the specified event using the provided entity as the event value.
-
-
-
Method Detail
-
intercept
public java.lang.Object intercept(io.micronaut.aop.MethodInvocationContext context)
- Specified by:
interceptin interfaceio.micronaut.aop.MethodInterceptor
-
getEventGroup
public abstract AbstractEventSourceInterceptor.EventGroup getEventGroup()
Return theEventGrouphandled by this interceptor.- Returns:
- the
EventGrouphandled by this interceptor
-
getHandledPreEventType
public abstract AbstractEventSourceInterceptor.EventType getHandledPreEventType()
Return thePREevent type this interceptor wishes to emit.- Returns:
- the
PREevent type this interceptor wishes to emit
-
getHandledPostEventType
public abstract AbstractEventSourceInterceptor.EventType getHandledPostEventType()
Return thePOSTevent type this interceptor wishes to emit.- Returns:
- the
POSTevent type this interceptor wishes to emit
-
trigger
protected boolean trigger(AbstractEventSourceInterceptor.EventType eventType, java.lang.Object entity)
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.
-
-