Package org.jboss.weld.interceptor.proxy
Class WeldInvocationContextImpl
- java.lang.Object
-
- org.jboss.weld.util.ForwardingInvocationContext
-
- org.jboss.weld.interceptor.proxy.WeldInvocationContextImpl
-
- All Implemented Interfaces:
javax.interceptor.InvocationContext,WeldInvocationContext
public class WeldInvocationContextImpl extends ForwardingInvocationContext implements WeldInvocationContext
Weld'sInvocationContextimplementation. This is a forwarding implementation that delegates most method calls to an underlyingInvocationContext. This allows multiple interceptor chains to be combined. A call toproceed()invokes the chain of intercepors in the given order. Once the chain finishes, theproceed()method of the delegate is invoked which results in the target method being invoked in case ofSimpleInvocationContext. Otherwise, the delegate chain is run.- Author:
- Jozef Hartinger
-
-
Field Summary
-
Fields inherited from interface org.jboss.weld.interceptor.WeldInvocationContext
INTERCEPTOR_BINDINGS_KEY
-
-
Constructor Summary
Constructors Constructor Description WeldInvocationContextImpl(Object target, Method targetMethod, Method proceed, Object[] parameters, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings, InterceptionDecorationContext.Stack stack)WeldInvocationContextImpl(Constructor<?> constructor, Object[] parameters, Map<String,Object> contextData, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings)WeldInvocationContextImpl(javax.interceptor.InvocationContext delegate, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings, CombinedInterceptorAndDecoratorStackMethodHandler currentHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.interceptor.InvocationContextdelegate()Set<Annotation>getInterceptorBindings()Return the set of interceptor bindings for a lifecycle callback, business method, timeout method, or constructor.<T extends Annotation>
Set<T>getInterceptorBindingsByType(Class<T> annotationType)Return the set of interceptor bindings with the specified annotation type.booleanhasNextInterceptor()protected ObjectinterceptorChainCompleted()protected ObjectinvokeNext()Objectproceed()-
Methods inherited from class org.jboss.weld.util.ForwardingInvocationContext
equals, getConstructor, getContextData, getMethod, getParameters, getTarget, getTimer, hashCode, setParameters, toString
-
-
-
-
Constructor Detail
-
WeldInvocationContextImpl
public WeldInvocationContextImpl(Constructor<?> constructor, Object[] parameters, Map<String,Object> contextData, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings)
-
WeldInvocationContextImpl
public WeldInvocationContextImpl(Object target, Method targetMethod, Method proceed, Object[] parameters, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings, InterceptionDecorationContext.Stack stack)
-
WeldInvocationContextImpl
public WeldInvocationContextImpl(javax.interceptor.InvocationContext delegate, List<InterceptorMethodInvocation> chain, Set<Annotation> interceptorBindings, CombinedInterceptorAndDecoratorStackMethodHandler currentHandler)
-
-
Method Detail
-
delegate
protected javax.interceptor.InvocationContext delegate()
- Specified by:
delegatein classForwardingInvocationContext
-
hasNextInterceptor
public boolean hasNextInterceptor()
-
interceptorChainCompleted
protected Object interceptorChainCompleted() throws Exception
- Throws:
Exception
-
proceed
public Object proceed() throws Exception
- Specified by:
proceedin interfacejavax.interceptor.InvocationContext- Overrides:
proceedin classForwardingInvocationContext- Throws:
Exception
-
getInterceptorBindingsByType
public <T extends Annotation> Set<T> getInterceptorBindingsByType(Class<T> annotationType)
Description copied from interface:WeldInvocationContextReturn the set of interceptor bindings with the specified annotation type.- Specified by:
getInterceptorBindingsByTypein interfaceWeldInvocationContext- Type Parameters:
T- subclass ofAnnotation- Parameters:
annotationType- type of annotation- Returns:
- a set of interceptor bindings with the specified annotation type
- See Also:
WeldInvocationContext.getInterceptorBindings()
-
getInterceptorBindings
public Set<Annotation> getInterceptorBindings()
Description copied from interface:WeldInvocationContextReturn the set of interceptor bindings for a lifecycle callback, business method, timeout method, or constructor.The returned set may be empty if only interceptors using the
Interceptorsannotation are associated.- Specified by:
getInterceptorBindingsin interfaceWeldInvocationContext- Returns:
- a set of interceptor bindings
-
-