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.MethodInterceptor
Base class for sync event source interceptors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractEventSourceInterceptor.EventGroup
Represents the logical operations for multiple event types (i.e., pre, post persist).static class
AbstractEventSourceInterceptor.EventType
Various entity event types used by Micronaut Data.
-
Field Summary
Fields Modifier and Type Field Description protected io.micronaut.data.model.runtime.RuntimeEntityRegistry
registry
RuntimeEntityRegistry
used for event notification.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractEventSourceInterceptor(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.EventGroup
getEventGroup()
Return theEventGroup
handled by this interceptor.abstract AbstractEventSourceInterceptor.EventType
getHandledPostEventType()
Return thePOST
event type this interceptor wishes to emit.abstract AbstractEventSourceInterceptor.EventType
getHandledPreEventType()
Return thePRE
event type this interceptor wishes to emit.java.lang.Object
intercept(io.micronaut.aop.MethodInvocationContext context)
protected boolean
trigger(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:
intercept
in interfaceio.micronaut.aop.MethodInterceptor
-
getEventGroup
public abstract AbstractEventSourceInterceptor.EventGroup getEventGroup()
Return theEventGroup
handled by this interceptor.- Returns:
- the
EventGroup
handled by this interceptor
-
getHandledPreEventType
public abstract AbstractEventSourceInterceptor.EventType getHandledPreEventType()
Return thePRE
event type this interceptor wishes to emit.- Returns:
- the
PRE
event type this interceptor wishes to emit
-
getHandledPostEventType
public abstract AbstractEventSourceInterceptor.EventType getHandledPostEventType()
Return thePOST
event type this interceptor wishes to emit.- Returns:
- the
POST
event 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.EventType
entity
- the event value- Returns:
- the result of any
PRE
events may be inspected to stop processing of an event. Any values returned forPOST
events is meaningless.
-
-