@Contract public interface InterceptionService
Singleton
scope. Only services
that are created by HK2 are candidates for interception.
In particular services created by the provide method of
the Factory
interface can not be intercepted.
An implementation of InterceptionService must be in the Singleton scope.
Implementations of InterceptionService will be instantiated as soon as
they are added to HK2 in order to avoid deadlocks and circular references.
Therefore it is recommended that implementations of InterceptionService
make liberal use of Provider
or IterableProvider
when injecting dependent services so that these services are not instantiated
when the InterceptionService is created
Modifier and Type | Method and Description |
---|---|
List<org.aopalliance.intercept.ConstructorInterceptor> |
getConstructorInterceptors(Constructor<?> constructor)
The single chosen constructor of a service that passes the
getDescriptorFilter() method will be passed
to this method to determine if it will intercepted |
Filter |
getDescriptorFilter()
If the returned filter returns true then the methods
of the service will be passed to
getMethodInterceptors(Method)
to determine if a method should be intercepted and the
constructor of the service will be passed to
getConstructorInterceptors(Constructor) to
determine if the constructor should be intercepted |
List<org.aopalliance.intercept.MethodInterceptor> |
getMethodInterceptors(Method method)
Each non-final method of a service that passes the
getDescriptorFilter() method will be passed
to this method to determine if it will intercepted |
Filter getDescriptorFilter()
getMethodInterceptors(Method)
to determine if a method should be intercepted and the
constructor of the service will be passed to
getConstructorInterceptors(Constructor)
to
determine if the constructor should be interceptedList<org.aopalliance.intercept.MethodInterceptor> getMethodInterceptors(Method method)
getDescriptorFilter()
method will be passed
to this method to determine if it will interceptedmethod
- A non-final method that may
be interceptedList<org.aopalliance.intercept.ConstructorInterceptor> getConstructorInterceptors(Constructor<?> constructor)
getDescriptorFilter()
method will be passed
to this method to determine if it will interceptedconstructor
- A constructor that may
be interceptedCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.