Top Description Methods
javax.enterprise.inject.spi

public Interface Interceptor<T>

extends Bean<T>
Type Parameters
<T>
the interceptor bean class
Imports
java.lang.annotation.Annotation, java.util.Set, javax.interceptor.InvocationContext

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.

Authors
Gavin King, Pete Muir, David Allen

Method Summary

Modifier and TypeMethod and Description
public Set<Annotation>

Returns:

the set of interceptor bindings
getInterceptorBindings
()

Obtains the interceptor bindings of the interceptor.

public Object

Returns:

the invocation return value
intercept
(InterceptionType type, T
the interceptor instance to invoke
instance
,
InvocationContext
the context for the invocation
ctx
)

Invokes the specified kind of lifecycle callback or method invocation interception upon the given interceptor instance.

public boolean

Returns:

returns true if the interceptor intercepts callbacks or business methods of the given type, and false otherwise.
intercepts
(InterceptionType type)

Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation.

Inherited from javax.enterprise.inject.spi.Bean:
getBeanClassgetInjectionPointsisNullable

Method Detail

getInterceptorBindingsback to summary
public Set<Annotation> getInterceptorBindings()

Obtains the interceptor bindings of the interceptor.

Returns:Set<Annotation>

the set of interceptor bindings

interceptback to summary
public 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:InterceptionType

the kind of interception

instance:T

the interceptor instance to invoke

ctx:InvocationContext

the context for the invocation

Returns:Object

the invocation return value

Exceptions
Exception:
thrown by the target method and/or the following interceptors in the chain
interceptsback to summary
public boolean intercepts(InterceptionType type)

Determines if the interceptor intercepts the specified kind of lifecycle callback or method invocation.

Parameters
type:InterceptionType

the kind of interception

Returns:boolean

returns true if the interceptor intercepts callbacks or business methods of the given type, and false otherwise.