Interface HelidonInterceptor<W>
- Type Parameters:
W
- type of the work item processed by the interceptor
- All Known Subinterfaces:
HelidonInterceptor.WithPostCompletion<W>
- All Known Implementing Classes:
HelidonInterceptor.Base
Executable
.
Implementing classes typically extend HelidonInterceptor.Base
.
See also the HelidonInterceptor.WithPostCompletion
interface.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
HelidonInterceptor
implementation providing as much logic as possible.static interface
Common behavior among interceptors with both pre-invocation and post-completion behavior. -
Method Summary
Modifier and TypeMethodDescriptionaroundConstruct
(jakarta.interceptor.InvocationContext context) Invoked during the intercepted constructor invocation.default Object
aroundConstruction
(jakarta.interceptor.InvocationContext context) Invokes the implementation'spreInvocation
logic for a constructor, once for each work item associated with the constructor.default Object
aroundInvocation
(jakarta.interceptor.InvocationContext context) Invokes the implementation's preInvocation logic for a method, once for each work item associated with the method.aroundInvoke
(jakarta.interceptor.InvocationContext context) Invoked during the intercepted method invocation.void
preInvocation
(jakarta.interceptor.InvocationContext context, W workItem) Performs whatever pre-invocation work is needed for the given context, applied to the specified work item.workItems
(Executable executable) Returns the work items the specific interceptor instance should process.
-
Method Details
-
aroundConstruction
Invokes the implementation'spreInvocation
logic for a constructor, once for each work item associated with the constructor.- Parameters:
context
-InvocationContext
- Returns:
- any value returned by the intercepted
Executable
- Throws:
Exception
- when the intercepted code throws an exception
-
aroundConstruct
Invoked during the intercepted constructor invocation.Typically, concrete implementations should extend
HelidonInterceptor.Base
which implements this method with@AroundConstruct
. Annotation processing for@AroundConstruct
does not recognize the annotation on adefault
method implementation defined on the interface.- Parameters:
context
- the invocation context for the intercepted call- Returns:
- the value returned from the intercepted constructor
- Throws:
Exception
- if the invoked constructor throws an exception
-
aroundInvocation
Invokes the implementation's preInvocation logic for a method, once for each work item associated with the method.- Parameters:
context
-InvocationContext
- Returns:
- any value returned by the intercepted
Executable
- Throws:
Exception
- when the intercepted code throws an exception
-
aroundInvoke
Invoked during the intercepted method invocation.Typically, concrete implementations should extend
HelidonInterceptor.Base
which implements this method with@AroundInvoke
. Annotation processing for@AroundInvoke
does not recognize the annotation on adefault
method implementation defined on the interface.- Parameters:
context
- the invocation context for the intercepted call- Returns:
- the value returned from the intercepted method
- Throws:
Exception
- if the invoked method throws an exception
-
workItems
Returns the work items the specific interceptor instance should process.- Parameters:
executable
- the specificExecutable
being intercepted- Returns:
- the work items pertinent to the specified
Executable
-
preInvocation
Performs whatever pre-invocation work is needed for the given context, applied to the specified work item.If the pre-invocation handler throws an exception, any other pre-invocation
- Parameters:
context
-InvocationContext
for the execution being interceptedworkItem
- the work item on which to operate
-