public abstract class AbstractEventSourceInterceptor
extends java.lang.Object
implements io.micronaut.aop.MethodInterceptor
| Modifier and Type | Class and 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.
|
| Modifier and Type | Field and Description |
|---|---|
protected io.micronaut.data.model.runtime.RuntimeEntityRegistry |
registry
RuntimeEntityRegistry used for event notification. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEventSourceInterceptor(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry)
Constructs a new AbstractEventSourceInterceptor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractEventSourceInterceptor.EventGroup |
getEventGroup()
Return the
EventGroup handled by this interceptor. |
abstract AbstractEventSourceInterceptor.EventType |
getHandledPostEventType()
Return the
POST event type this interceptor wishes to emit. |
abstract AbstractEventSourceInterceptor.EventType |
getHandledPreEventType()
Return the
PRE 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.
|
protected io.micronaut.data.model.runtime.RuntimeEntityRegistry registry
RuntimeEntityRegistry used for event notification.protected AbstractEventSourceInterceptor(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry)
registry - the RuntimeEntityRegistrypublic java.lang.Object intercept(io.micronaut.aop.MethodInvocationContext context)
intercept in interface io.micronaut.aop.MethodInterceptorpublic abstract AbstractEventSourceInterceptor.EventGroup getEventGroup()
EventGroup handled by this interceptor.EventGroup handled by this interceptorpublic abstract AbstractEventSourceInterceptor.EventType getHandledPreEventType()
PRE event type this interceptor wishes to emit.PRE event type this interceptor wishes to emitpublic abstract AbstractEventSourceInterceptor.EventType getHandledPostEventType()
POST event type this interceptor wishes to emit.POST event type this interceptor wishes to emitprotected boolean trigger(AbstractEventSourceInterceptor.EventType eventType, java.lang.Object entity)
eventType - the AbstractEventSourceInterceptor.EventTypeentity - the event valuePRE events may be inspected to stop processing
of an event. Any values returned for POST events is meaningless.