/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Convenience method to set the underlying bean instance for a proxy. * * @param proxy the proxy instance * @param beanInstance the instance of the bean */ public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
/** * Method to create a new proxy that wraps the bean instance. * * @param beanInstance the bean instance * @return a new proxy object */ public T create(BeanInstance beanInstance) { final T proxy = (System.getSecurityManager() == null) ? run() : AccessController.doPrivileged(this); ((ProxyObject) proxy).weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); return proxy; }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).weld_setHandler(handler); } }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).weld_setHandler(handler); } }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).setHandler(handler); } }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).weld_setHandler(handler); } }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).weld_setHandler(handler); } }
@Override public void inject(T instance, CreationalContext<T> ctx) { super.inject(instance, ctx); if (accessibleField != null && instance instanceof DecoratorProxy) { // this code is only applicable if the delegate is injected into a field // as the proxy can't intercept the delegate when setting the field // we need to now read the delegate from the field // this is only needed for fields, as constructor and method injection are handed // at injection time Object delegate; try { delegate = accessibleField.get(instance); } catch (IllegalAccessException e) { throw UtilLogger.LOG.accessErrorOnField(accessibleField.getName(), accessibleField.getDeclaringClass(), e); } final ProxyMethodHandler handler = new ProxyMethodHandler(beanManager.getContextId(), new TargetBeanInstance(delegate), getBean()); ((ProxyObject) instance).weld_setHandler(handler); } }
return new ProxyMethodHandler(contextId, new TargetBeanInstance(args[0]), getBean()); } else { if (beanInstance == null) {
return new ProxyMethodHandler(contextId, new TargetBeanInstance(args[0]), getBean()); } else { if (beanInstance == null) {