-
- 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.
- Author:
- Gavin King, Pete Muir, David Allen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Set<Annotation>
getInterceptorBindings()
Obtains the interceptor bindings of the interceptor.Object
intercept(InterceptionType type, T instance, InvocationContext ctx)
Invokes the specified kind of lifecycle callback or method invocation interception upon the given interceptor instance.boolean
intercepts(InterceptionType type)
Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation.-
Methods inherited from interface javax.enterprise.inject.spi.Bean
getBeanClass, getInjectionPoints, isNullable
-
Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
-
-
-
Method Detail
-
getInterceptorBindings
Set<Annotation> getInterceptorBindings()
Obtains the interceptor bindings of the interceptor.
- Returns:
- the set of interceptor bindings
-
intercepts
boolean 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 true if the interceptor intercepts callbacks or business methods of the given type, and false otherwise.
-
intercept
Object 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 interceptioninstance
- the interceptor instance to invokectx
- the context for the invocation- Returns:
- the invocation return value
- Throws:
exceptions
- thrown by the target method and/or the following interceptors in the chainException
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/enterprise/inject/spi/Interceptor.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.