Interface InterceptorInfo
-
- All Superinterfaces:
BeanInfo
public interface InterceptorInfo extends BeanInfo
Interceptors are managed beans annotated@Interceptor
. An interceptor declares a set of interceptor binding annotations, used to associate the interceptor with target beans. It also declares at most one interceptor method for each interception type. Interception types are:@AroundInvoke
: intercept business method invocations,@AroundConstruct
: intercept constructor invocations,@PostConstruct
: called after the container creates the target instance and completes dependency injection,@PreDestroy
: called before the container destroys the target instance.
@Priority
to become enabled.Note that this description applies to CDI Lite. There are more ways to declare an interceptor, but those are only present in CDI Full.
- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default InterceptorInfo
asInterceptor()
Returns this bean as an interceptor.Collection<AnnotationInfo>
interceptorBindings()
Returns the set of interceptor binding annotations declared on this interceptor.boolean
intercepts(InterceptionType interceptionType)
Returns whether this interceptor declares an interceptor method for given interception type.default boolean
isInterceptor()
Returns whether this bean is an interceptor.-
Methods inherited from interface jakarta.enterprise.inject.build.compatible.spi.BeanInfo
declaringClass, disposer, injectionPoints, isAlternative, isClassBean, isProducerField, isProducerMethod, isSynthetic, name, priority, producerField, producerMethod, qualifiers, scope, stereotypes, types
-
-
-
-
Method Detail
-
interceptorBindings
Collection<AnnotationInfo> interceptorBindings()
Returns the set of interceptor binding annotations declared on this interceptor.- Returns:
- immutable set of interceptor binding annotations, never
null
-
intercepts
boolean intercepts(InterceptionType interceptionType)
Returns whether this interceptor declares an interceptor method for given interception type.- Parameters:
interceptionType
- the type of interception- Returns:
- whether this interceptor declares an interceptor method for given interception type
-
isInterceptor
default boolean isInterceptor()
Description copied from interface:BeanInfo
Returns whether this bean is an interceptor.- Specified by:
isInterceptor
in interfaceBeanInfo
- Returns:
- whether this bean is an interceptor
-
asInterceptor
default InterceptorInfo asInterceptor()
Description copied from interface:BeanInfo
Returns this bean as an interceptor.- Specified by:
asInterceptor
in interfaceBeanInfo
- Returns:
- this interceptor, never
null
-
-