Class DefaultInterceptionService
- java.lang.Object
-
- org.glassfish.hk2.extras.interception.internal.DefaultInterceptionService
-
- All Implemented Interfaces:
InterceptionService
@Singleton @Visibility(LOCAL) public class DefaultInterceptionService extends Object implements InterceptionService
A default implementation of the interception service using annotation to denote services that are to be intercepted and other annotations to match methods or constructors to interceptors- Author:
- jwells
-
-
Constructor Summary
Constructors Constructor Description DefaultInterceptionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.aopalliance.intercept.ConstructorInterceptor>
getConstructorInterceptors(Constructor<?> constructor)
The single chosen constructor of a service that passes theInterceptionService.getDescriptorFilter()
method will be passed to this method to determine if it will interceptedFilter
getDescriptorFilter()
If the returned filter returns true then the methods of the service will be passed toInterceptionService.getMethodInterceptors(Method)
to determine if a method should be intercepted and the constructor of the service will be passed toInterceptionService.getConstructorInterceptors(Constructor)
to determine if the constructor should be interceptedList<org.aopalliance.intercept.MethodInterceptor>
getMethodInterceptors(Method method)
Each non-final method of a service that passes theInterceptionService.getDescriptorFilter()
method will be passed to this method to determine if it will intercepted
-
-
-
Method Detail
-
getDescriptorFilter
public Filter getDescriptorFilter()
Description copied from interface:InterceptionService
If the returned filter returns true then the methods of the service will be passed toInterceptionService.getMethodInterceptors(Method)
to determine if a method should be intercepted and the constructor of the service will be passed toInterceptionService.getConstructorInterceptors(Constructor)
to determine if the constructor should be intercepted- Specified by:
getDescriptorFilter
in interfaceInterceptionService
- Returns:
- The filter that will be applied to a descriptor to determine if it is to be intercepted. Should not return null
-
getMethodInterceptors
public List<org.aopalliance.intercept.MethodInterceptor> getMethodInterceptors(Method method)
Description copied from interface:InterceptionService
Each non-final method of a service that passes theInterceptionService.getDescriptorFilter()
method will be passed to this method to determine if it will intercepted- Specified by:
getMethodInterceptors
in interfaceInterceptionService
- Parameters:
method
- A non-final method that may be intercepted- Returns:
- if null (or an empty list) then this method should NOT be intercepted. Otherwise the list of interceptors to apply to this method
-
getConstructorInterceptors
public List<org.aopalliance.intercept.ConstructorInterceptor> getConstructorInterceptors(Constructor<?> constructor)
Description copied from interface:InterceptionService
The single chosen constructor of a service that passes theInterceptionService.getDescriptorFilter()
method will be passed to this method to determine if it will intercepted- Specified by:
getConstructorInterceptors
in interfaceInterceptionService
- Parameters:
constructor
- A constructor that may be intercepted- Returns:
- if null (or an empty list) then this constructor should NOT be intercepted. Otherwise the list of interceptors to apply to this method
-
-