Package javax.enterprise.inject

Examples of javax.enterprise.inject.AmbiguousResolutionException


            throw new UnsatisfiedResolutionException(message.toString());
        }

        if (resolvedSet.size() > 1)
        {
            throw new AmbiguousResolutionException("There is more than one api type with : " + type.getName() + " with qualifiers : " + qualifierMessage);
        }

        Bean<?> bean = resolvedSet.iterator().next();
        WebBeansUtil.checkUnproxiableApiType(bean, bean.getScope());
View Full Code Here


            return null;
        }

        if (set.size() > 1)
        {
            throw new AmbiguousResolutionException("There are more than one WebBeans with name : " + name);
        }

        component = (AbstractOwbBean<?>) set.iterator().next();

        object = getInstance(component, creationalContext);
View Full Code Here

            set = this.injectionResolver.findBySpecialization(set);
        }
       
        if(set.size() > 0 && set.size() > 1)
        {
            throw new AmbiguousResolutionException("Ambigious resolution");
        }
       
        return (Bean<? extends X>)set.iterator().next();
    }
View Full Code Here

    {
        violationMessage.addLine("found beans: ");

        addBeanInfo(beans, violationMessage);

        throw new AmbiguousResolutionException(violationMessage.toString());
    }
View Full Code Here

    private <T> Bean<T> resolveUniqueBean(Type type, Set<Bean<T>> beans) {
        if (beans.size() == 0) {
            throw new UnsatisfiedResolutionException("Unable to resolve any beans of " + type);
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("More than one bean available (" + beans + ")");
        }
        return beans.iterator().next();
    }
View Full Code Here

    public static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans) {
        if (beans.size() == 0) {
            throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("More than one bean available for type " + type);
        }
        return beans.iterator().next();
    }
View Full Code Here

    public static Object getInstanceByName(BeanManager manager, String name) {
        Set<Bean<?>> beans = manager.getBeans(name);
        if (beans.size() == 0) {
            return null;
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("Resolved multiple Web Beans with " + name);
        } else {
            Bean<?> bean = beans.iterator().next();
            return manager.getReference(bean, bean.getTypes().iterator().next(), manager.createCreationalContext(bean));
        }
    }
View Full Code Here

    private <T> Bean<T> resolveUniqueBean(Type type, Set<Bean<T>> beans) {
        if (beans.size() == 0) {
            throw new UnsatisfiedResolutionException("Unable to resolve any beans of " + type);
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("More than one bean available (" + beans + ")");
        }
        return beans.iterator().next();
    }
View Full Code Here

    if (!ambiguous.isEmpty()) {
      ambiguous.add(selected);

      String message = getExceptionMessage(type, ambiguous);
      throw new DemoiselleException(message, new AmbiguousResolutionException());
    }
  }
View Full Code Here

    private <T> Bean<T> resolveUniqueBean(Type type, Set<Bean<T>> beans) {
        if (beans.size() == 0) {
            throw new UnsatisfiedResolutionException("Unable to resolve any beans of " + type);
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("More than one bean available (" + beans + ")");
        }
        return beans.iterator().next();
    }
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.AmbiguousResolutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.