/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }
/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }
/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }
/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }
/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }
/** * Gets a client proxy for a bean * <p/> * Looks for a proxy in the pool. If not found, one is created and added to * the pool if the create argument is true. * * @param bean The bean to get a proxy to * @return the client proxy for the bean */ public <T> T getClientProxy(final Bean<T> bean, Type requestedType) { // let's first try to use the proxy that implements all the bean types T proxy = beanTypeClosureProxyPool.getCastValue(bean); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { /* * the bean may have a type that is not proxyable - this is not a problem as long as the unproxyable * type is not in the type closure of the requested type * https://issues.jboss.org/browse/WELD-1052 */ proxy = requestedTypeClosureProxyPool.getCastValue(new RequestedTypeHolder(requestedType, bean)); if (proxy == BEAN_NOT_PROXYABLE_MARKER) { throw Proxies.getUnproxyableTypeException(requestedType, services()); } } BeanLogger.LOG.lookedUpClientProxy(proxy.getClass(), bean); return proxy; }