Class InterceptionFactoryImpl<T>
- java.lang.Object
-
- org.jboss.weld.injection.InterceptionFactoryImpl<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
InterceptionFactory<T>
public class InterceptionFactoryImpl<T> extends Object implements InterceptionFactory<T>
Instances of this class are not suitable for sharing between threads.- Author:
- Martin Kouba
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedTypeConfigurator<T>configure()Returns anAnnotatedTypeConfiguratorinitialized with theAnnotatedTypecreated either for the class passed toBeanManager.createInterceptionFactory(CreationalContext, Class)or derived from theInterceptionFactoryparameter injection point.TcreateInterceptedInstance(T instance)Returns a wrapper instance whose method invocations are intercepted by method interceptors and forwarded to a provided instance.InterceptionFactory<T>ignoreFinalMethods()Instructs the container to ignore all non-static, final methods with public, protected or default visibility declared by any class in the type hierarchy of the intercepted instance during invocation ofInterceptionFactory.createInterceptedInstance(Object).static <F> InterceptionFactoryImpl<F>of(BeanManagerImpl beanManager, CreationalContext<?> creationalContext, AnnotatedType<F> annotatedType)
-
-
-
Method Detail
-
of
public static <F> InterceptionFactoryImpl<F> of(BeanManagerImpl beanManager, CreationalContext<?> creationalContext, AnnotatedType<F> annotatedType)
- Parameters:
beanManager-creationalContext-annotatedType-- Returns:
-
ignoreFinalMethods
public InterceptionFactory<T> ignoreFinalMethods()
Description copied from interface:InterceptionFactoryInstructs the container to ignore all non-static, final methods with public, protected or default visibility declared by any class in the type hierarchy of the intercepted instance during invocation ofInterceptionFactory.createInterceptedInstance(Object).Ignored methods should never be invoked upon the wrapper instance created by
InterceptionFactory.createInterceptedInstance(Object). Otherwise, unpredictable behavior results.- Specified by:
ignoreFinalMethodsin interfaceInterceptionFactory<T>- Returns:
- self
-
configure
public AnnotatedTypeConfigurator<T> configure()
Description copied from interface:InterceptionFactoryReturns anAnnotatedTypeConfiguratorinitialized with theAnnotatedTypecreated either for the class passed toBeanManager.createInterceptionFactory(CreationalContext, Class)or derived from theInterceptionFactoryparameter injection point.The configurator allows to add or remove interceptor bindings used to associate interceptors with the wrapper instance returned by
InterceptionFactory.createInterceptedInstance(Object).Each call returns the same
AnnotatedTypeConfigurator.- Specified by:
configurein interfaceInterceptionFactory<T>- Returns:
- an
AnnotatedTypeConfiguratorto configure interceptors bindings
-
createInterceptedInstance
public T createInterceptedInstance(T instance)
Description copied from interface:InterceptionFactoryReturns a wrapper instance whose method invocations are intercepted by method interceptors and forwarded to a provided instance.This method should only be called once, subsequent calls will throw an
IllegalStateException.If T is not proxyable as defined in section 3.11 of the spec an
UnproxyableResolutionExceptionexception is thrown. CallingInterceptionFactory.ignoreFinalMethods()before this method can loosen these restrictions.If the provided instance is an internal container construct (such as client proxy), non-portable behavior results.
- Specified by:
createInterceptedInstancein interfaceInterceptionFactory<T>- Parameters:
instance- The provided instance- Returns:
- a wrapper instance
-
-