T - the interceptor bean classpublic interface Interceptor<T> extends Bean<T>
Represents an enabled interceptor.
Since CDI 2.0, an implementation of this interface may implement Prioritized in order to enable the interceptor with
given priority value for entire application.
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.annotation.Annotation> |
getInterceptorBindings()
Obtains the interceptor bindings of the interceptor.
|
java.lang.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.
|
getBeanClass, getInjectionPoints, isNullablecreate, destroygetName, getQualifiers, getScope, getStereotypes, getTypes, isAlternativejava.util.Set<java.lang.annotation.Annotation> getInterceptorBindings()
Obtains the interceptor bindings of the interceptor.
boolean intercepts(InterceptionType type)
Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation.
type - the kind of interceptiontrue if the interceptor intercepts callbacks or business methods of the given type, and
false otherwise.java.lang.Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws java.lang.Exception
Invokes the specified kind of lifecycle callback or method invocation interception upon the given interceptor instance.
type - the kind of interceptioninstance - the interceptor instance to invokectx - the context for the invocationjava.lang.Exception - thrown by the target method and/or the following interceptors in the chain