Package jakarta.enterprise.inject.spi
Interface Interceptor<T>
- 
- Type Parameters:
- T- the interceptor bean class
 - All Superinterfaces:
- Bean<T>,- BeanAttributes<T>,- Contextual<T>
 
 public interface Interceptor<T> extends Bean<T> Represents an enabled interceptor. Since CDI 2.0, an implementation of this interface may implement Prioritizedin order to enable the interceptor with given priority value for entire application.- Author:
- Gavin King, Pete Muir, David Allen
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Annotation>getInterceptorBindings()Obtains the interceptor bindings of the interceptor.Objectintercept(InterceptionType type, T instance, InvocationContext ctx)Invokes the specified kind of lifecycle callback or method invocation interception upon the given interceptor instance.booleanintercepts(InterceptionType type)Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation.- 
Methods inherited from interface jakarta.enterprise.inject.spi.BeangetBeanClass, getInjectionPoints
 - 
Methods inherited from interface jakarta.enterprise.inject.spi.BeanAttributesgetName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
 - 
Methods inherited from interface jakarta.enterprise.context.spi.Contextualcreate, destroy
 
- 
 
- 
- 
- 
Method Detail- 
getInterceptorBindingsSet<Annotation> getInterceptorBindings() Obtains the interceptor bindings of the interceptor. - Returns:
- the set of interceptor bindings
 
 - 
interceptsboolean intercepts(InterceptionType type) Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation. - Parameters:
- type- the kind of interception
- Returns:
- returns trueif the interceptor intercepts callbacks or business methods of the given type, andfalseotherwise.
 
 - 
interceptObject intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception Invokes the specified kind of lifecycle callback or method invocation interception upon the given interceptor instance. - Parameters:
- type- the kind of interception
- instance- the interceptor instance to invoke
- ctx- the context for the invocation
- Returns:
- the invocation return value
- Throws:
- Exception- thrown by the target method and/or the following interceptors in the chain
 
 
- 
 
-