@Override public InterceptorResolutionService.BeanInterceptorInfo interceptorInfo() { return EjbInjectionTargetImpl.class.cast(getInjectionTarget()).getInterceptorInfo(); }
public CdiEjbBean(final BeanContext beanContext, final WebBeansContext webBeansContext, final AnnotatedType<T> at, final BeanAttributes<T> attributes) { this(beanContext, webBeansContext, beanContext.getManagedClass(), at, new EjbInjectionTargetFactory<T>(beanContext, at, webBeansContext), attributes); EjbInjectionTargetImpl.class.cast(getInjectionTarget()).setCdiEjbBean(this); }
public CdiEjbBean(final BeanContext beanContext, final WebBeansContext webBeansContext, final AnnotatedType<T> at) { this(beanContext, webBeansContext, beanContext.getManagedClass(), at, new EjbInjectionTargetFactory<T>(at, webBeansContext)); EjbInjectionTargetImpl.class.cast(getInjectionTarget()).setCdiEjbBean(this); }
final InjectionTargetImpl<?> injectionTarget = InjectionTargetImpl.class.cast(get(CdiEjbBean.class).getInjectionTarget()); final InterceptorResolutionService.BeanInterceptorInfo info = injectionTarget.getInterceptorInfo(); if (info == null) {
final InjectionTargetImpl<?> injectionTarget = InjectionTargetImpl.class.cast(get(CdiEjbBean.class).getInjectionTarget()); final InterceptorResolutionService.BeanInterceptorInfo info = injectionTarget.getInterceptorInfo(); if (info == null) {
public NewCdiEjbBean(final CdiEjbBean<T> that) { super(that.getBeanContext(), that.getWebBeansContext(), that.getBeanContext().getManagedClass(), that.getAnnotatedType(), new NewEjbInjectionTargetFactory<T>(that.getAnnotatedType(), that.getWebBeansContext(), that.getInjectionTarget())); this.id = that.getId() + "NewBean"; initInternals(); }
bean.getInjectionTarget().preDestroy(instance.bean);
bean.getInjectionTarget().preDestroy(instance.bean);
bc.set(InterceptorResolutionService.BeanInterceptorInfo.class, InjectionTargetImpl.class.cast(cdiEjbBean.getInjectionTarget()).getInterceptorInfo()); cdiEjbBean.initInternals();
bc.set(InterceptorResolutionService.BeanInterceptorInfo.class, InjectionTargetImpl.class.cast(cdiEjbBean.getInjectionTarget()).getInterceptorInfo()); cdiEjbBean.initInternals();
if (cdiEjbBean != null && !dynamicallyImplemented && CdiEjbBean.EjbInjectionTargetImpl.class.isInstance(cdiEjbBean.getInjectionTarget())) { rootInstance = CdiEjbBean.EjbInjectionTargetImpl.class.cast(cdiEjbBean.getInjectionTarget()).createNewPojo(creationalContext); } else { // not a cdi bean rootInstance = getManagedClass().newInstance(); cdiEjbBean.getInjectionTarget().postConstruct(beanInstance); final Class<?> proxyClass = Class.class.cast(Reflections.get(cdiEjbBean.getInjectionTarget(), "proxyClass")); if (proxyClass != null) { // means interception final InterceptorResolutionService.BeanInterceptorInfo interceptorInfo = cdiEjbBean.getBeanContext().get(InterceptorResolutionService.BeanInterceptorInfo.class);
public NewCdiEjbBean(final CdiEjbBean<T> that) { super(that.getBeanContext(), that.getWebBeansContext(), that.getBeanContext().getManagedClass(), that.getAnnotatedType(), new NewEjbInjectionTargetFactory<T>(that.getAnnotatedType(), that.getWebBeansContext(), that.getInjectionTarget()), new BeanAttributesImpl<T>(that)); this.id = that.getId() + "NewBean"; initInternals(); }
@SuppressWarnings("unchecked") private void freeInstance(final ThreadContext callContext, final Instance instance) { try { callContext.setCurrentOperation(Operation.PRE_DESTROY); final BeanContext beanContext = callContext.getBeanContext(); final Method remove = instance.bean instanceof SessionBean ? removeSessionBeanMethod : null; final List<InterceptorData> callbackInterceptors = beanContext.getCallbackInterceptors(); final InterceptorStack interceptorStack = new InterceptorStack(instance.bean, remove, Operation.PRE_DESTROY, callbackInterceptors, instance.interceptors); final CdiEjbBean<Object> bean = beanContext.get(CdiEjbBean.class); if (bean != null) { // TODO: see if it should be called before or after next call bean.getInjectionTarget().preDestroy(instance.bean); } interceptorStack.invoke(); if (instance.creationalContext != null) { instance.creationalContext.release(); } } catch (final Throwable re) { logger.error("The bean instance " + instance + " threw a system exception:" + re, re); } }
if (cdiEjbBean != null && !dynamicallyImplemented && CdiEjbBean.EjbInjectionTargetImpl.class.isInstance(cdiEjbBean.getInjectionTarget())) { rootInstance = CdiEjbBean.EjbInjectionTargetImpl.class.cast(cdiEjbBean.getInjectionTarget()).createNewPojo(creationalContext); } else { // not a cdi bean rootInstance = getManagedClass().newInstance(); cdiEjbBean.getInjectionTarget().postConstruct(beanInstance); final Class<?> proxyClass = Class.class.cast(Reflections.get(cdiEjbBean.getInjectionTarget(), "proxyClass")); if (proxyClass != null) { // means interception final InterceptorResolutionService.BeanInterceptorInfo interceptorInfo = cdiEjbBean.getBeanContext().get(InterceptorResolutionService.BeanInterceptorInfo.class);
@SuppressWarnings("unchecked") private void freeInstance(final ThreadContext callContext, final Instance instance) { try { callContext.setCurrentOperation(Operation.PRE_DESTROY); final BeanContext beanContext = callContext.getBeanContext(); final Method remove = instance.bean instanceof SessionBean ? removeSessionBeanMethod : null; final List<InterceptorData> callbackInterceptors = beanContext.getCallbackInterceptors(); final InterceptorStack interceptorStack = new InterceptorStack(instance.bean, remove, Operation.PRE_DESTROY, callbackInterceptors, instance.interceptors); final CdiEjbBean<Object> bean = beanContext.get(CdiEjbBean.class); if (bean != null) { // TODO: see if it should be called before or after next call bean.getInjectionTarget().preDestroy(instance.bean); } interceptorStack.invoke(); if (instance.creationalContext != null) { instance.creationalContext.release(); } } catch (final Throwable re) { logger.error("The bean instance " + instance + " threw a system exception:" + re, re); } }
@SuppressWarnings("unchecked") private void freeInstance(final ThreadContext callContext, final Instance instance) { try { callContext.setCurrentOperation(Operation.PRE_DESTROY); final BeanContext beanContext = callContext.getBeanContext(); final Method remove = instance.bean instanceof SessionBean ? removeSessionBeanMethod : null; final List<InterceptorData> callbackInterceptors = beanContext.getCallbackInterceptors(); final InterceptorStack interceptorStack = new InterceptorStack(instance.bean, remove, Operation.PRE_DESTROY, callbackInterceptors, instance.interceptors); final CdiEjbBean<Object> bean = beanContext.get(CdiEjbBean.class); if (bean != null) { // TODO: see if it should be called before or after next call bean.getInjectionTarget().preDestroy(instance.bean); } interceptorStack.invoke(); if (instance.creationalContext != null) { instance.creationalContext.release(); } } catch (final Throwable re) { logger.error("The bean instance " + instance + " threw a system exception:" + re, re); } }
bean.getInjectionTarget().preDestroy(instance.bean);
bean.getInjectionTarget().preDestroy(instance.bean);