private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
private T createProxy(InjectionPoint injectionPoint, CreationalContext<?> creationalContext) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); TargetBeanInstance newTargetBeanInstance = new TargetBeanInstance(targetBeanInstance); Decorator<Object> decorator = Reflections.cast(decorators.get(counter++)); DecoratorProxyMethodHandler methodHandler = createMethodHandler(injectionPoint, creationalContext, decorator); newTargetBeanInstance.setInterceptorsHandler(methodHandler); ProxyFactory.setBeanInstance(beanManager.getContextId(), proxy, newTargetBeanInstance, bean); return proxy; }
@Override public T newInstance(CreationalContext<T> ctx, BeanManagerImpl manager) { try { T instance = AccessController.doPrivileged(NewInstanceAction.of(proxyClass)); if (!bean.getScope().equals(Dependent.class)) { ctx.push(instance); } ProxyFactory.setBeanInstance(bean.getBeanManager().getContextId(), instance, createEnterpriseTargetBeanInstance(), bean); return instance; } catch (PrivilegedActionException e) { if (e.getCause() instanceof InstantiationException) { throw new WeldException(BeanLogger.LOG.proxyInstantiationFailed(this), e.getCause()); } else if (e.getCause() instanceof IllegalAccessException) { throw new WeldException(BeanLogger.LOG.proxyInstantiationBeanAccessFailed(this), e.getCause()); } else { throw new WeldException(e.getCause()); } } catch (Exception e) { throw BeanLogger.LOG.sessionBeanProxyInstantiationFailed(bean, proxyClass, e); } }
@Override public T newInstance(CreationalContext<T> ctx, BeanManagerImpl manager) { try { T instance = AccessController.doPrivileged(NewInstanceAction.of(proxyClass)); if (!bean.getScope().equals(Dependent.class)) { ctx.push(instance); } ProxyFactory.setBeanInstance(bean.getBeanManager().getContextId(), instance, createEnterpriseTargetBeanInstance(), bean); return instance; } catch (PrivilegedActionException e) { if (e.getCause() instanceof InstantiationException) { throw new WeldException(BeanLogger.LOG.proxyInstantiationFailed(this), e.getCause()); } else if (e.getCause() instanceof IllegalAccessException) { throw new WeldException(BeanLogger.LOG.proxyInstantiationBeanAccessFailed(this), e.getCause()); } else { throw new WeldException(e.getCause()); } } catch (Exception e) { throw BeanLogger.LOG.sessionBeanProxyInstantiationFailed(bean, proxyClass, e); } }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).weld_setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).weld_setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).weld_setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).weld_setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }
@Override protected T newInstance(Object[] parameterValues) { // Once the instance is created, a method handler is required regardless of whether // an actual bean instance is known yet. final T instance = super.newInstance(parameterValues); if (decorator) { BeanInstance beanInstance = null; if (hasDelegateInjectionPoint()) { Object decoratorDelegate = parameterValues[delegateInjectionPointPosition]; beanInstance = new TargetBeanInstance(decoratorDelegate); } ProxyFactory.setBeanInstance(contextId, instance, beanInstance, bean); } else { if (instance instanceof ProxyObject) { ((ProxyObject) instance).weld_setHandler(new CombinedInterceptorAndDecoratorStackMethodHandler()); // Set method handler for private methods if necessary InterceptedSubclassFactory.setPrivateMethodHandler(instance); } } return instance; }