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
Modifier and TypeClassDescriptionstatic enum
Represents the logical operations for multiple event types (i.e., pre, post persist).static enum
Various entity event types used by Micronaut Data. -
Field Summary
Modifier and TypeFieldDescriptionprotected final io.micronaut.data.model.runtime.RuntimeEntityRegistry
RuntimeEntityRegistry
used for event notification.Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractEventSourceInterceptor
(io.micronaut.data.model.runtime.RuntimeEntityRegistry registry) Constructs a new AbstractEventSourceInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionReturn theEventGroup
handled by this interceptor.Return thePOST
event type this interceptor wishes to emit.Return thePRE
event type this interceptor wishes to emit.intercept
(io.micronaut.aop.MethodInvocationContext context) protected boolean
trigger
(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, wait
Methods inherited from interface io.micronaut.aop.MethodInterceptor
intercept
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Field Details
-
registry
protected final io.micronaut.data.model.runtime.RuntimeEntityRegistry registryRuntimeEntityRegistry
used 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:
intercept
in interfaceio.micronaut.aop.MethodInterceptor
-
getEventGroup
Return theEventGroup
handled by this interceptor.- Returns:
- the
EventGroup
handled by this interceptor
-
getHandledPreEventType
Return thePRE
event type this interceptor wishes to emit.- Returns:
- the
PRE
event type this interceptor wishes to emit
-
getHandledPostEventType
Return thePOST
event type this interceptor wishes to emit.- Returns:
- the
POST
event type this interceptor wishes to emit
-
trigger
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.
-