public abstract class AbstractEventSourceInterceptor
extends java.lang.Object
implements io.micronaut.aop.MethodInterceptor
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractEventSourceInterceptor.EventGroup
Represents the logical operations for multiple event types (i.e., pre, post persist).
|
protected 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 |
---|---|
protected abstract AbstractEventSourceInterceptor.EventGroup |
getEventGroup()
Return the
EventGroup handled by this interceptor. |
protected abstract AbstractEventSourceInterceptor.EventType |
getHandledPostEventType()
Return the
POST event type this interceptor wishes to emit. |
protected abstract AbstractEventSourceInterceptor.EventType |
getHandledPreEventType()
Return the
PRE event type this interceptor wishes to emit. |
java.lang.Object |
intercept(io.micronaut.aop.MethodInvocationContext context) |
protected java.lang.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 RuntimeEntityRegistry
public java.lang.Object intercept(io.micronaut.aop.MethodInvocationContext context)
intercept
in interface io.micronaut.aop.MethodInterceptor
protected abstract AbstractEventSourceInterceptor.EventGroup getEventGroup()
EventGroup
handled by this interceptor.EventGroup
handled by this interceptorprotected abstract AbstractEventSourceInterceptor.EventType getHandledPreEventType()
PRE
event type this interceptor wishes to emit.PRE
event type this interceptor wishes to emitprotected abstract AbstractEventSourceInterceptor.EventType getHandledPostEventType()
POST
event type this interceptor wishes to emit.POST
event type this interceptor wishes to emitprotected java.lang.Boolean trigger(AbstractEventSourceInterceptor.EventType eventType, java.lang.Object entity)
eventType
- the AbstractEventSourceInterceptor.EventType
entity
- the event valuePRE
events may be inspected to stop processing
of an event. Any values returned for POST
events is meaningless.