public abstract class MethodInvocationStrategy extends Object
BeanManager injection point (common in extensions)EventMetadata injection point| Modifier and Type | Field and Description |
|---|---|
protected Class<? extends RuntimeException> |
exceptionTypeToThrow |
| Modifier and Type | Method and Description |
|---|---|
protected void |
endInterceptionContext() |
static MethodInvocationStrategy |
forDisposer(MethodInjectionPoint<?,?> method,
BeanManagerImpl manager) |
static MethodInvocationStrategy |
forObserver(MethodInjectionPoint<?,?> method,
BeanManagerImpl manager) |
abstract <T> void |
invoke(Object receiver,
MethodInjectionPoint<?,?> method,
T instance,
BeanManagerImpl manager,
javax.enterprise.context.spi.CreationalContext<?> creationalContext) |
protected boolean |
startInterceptionContextIfNeeded(Object receiver,
MethodInjectionPoint<?,?> method)
This method ensures that final observers on proxied beans cannot trigger interception when referencing otherwise
intercepted method in observer body - e.g.
|
protected final Class<? extends RuntimeException> exceptionTypeToThrow
public static MethodInvocationStrategy forDisposer(MethodInjectionPoint<?,?> method, BeanManagerImpl manager)
public static MethodInvocationStrategy forObserver(MethodInjectionPoint<?,?> method, BeanManagerImpl manager)
public abstract <T> void invoke(Object receiver, MethodInjectionPoint<?,?> method, T instance, BeanManagerImpl manager, javax.enterprise.context.spi.CreationalContext<?> creationalContext)
protected boolean startInterceptionContextIfNeeded(Object receiver, MethodInjectionPoint<?,?> method)
InterceptedSubclassFactory#invokeMethodHandler() but requires special handling here since observers
can be private and final and we cannot override them on proxies.
All implementations of invoke(Object, MethodInjectionPoint, Object, BeanManagerImpl, CreationalContext)
should call this method prior to invoking observer itself in order to start the interception context and
if this method returns true, endInterceptionContext() should be invoked right after observer method
invocation to tear down the context from stack.protected void endInterceptionContext()
Copyright © 2019. All rights reserved.