Package javax.enterprise.inject

Examples of javax.enterprise.inject.AmbiguousResolutionException


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

        addBeanInfo(beans, violationMessage);

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


                    "Injection points for GenericRoleVoter needs an additional " + config.getNamedRoleCheck() +
                            " annotation to determine the correct bean");
        }
        NamedRole[] roles = AnnotationUtil.getRoleValues(annotation);
        if (roles.length>1) {
            throw new AmbiguousResolutionException("Only one named role can be specified.");
        }


        return CDIUtil.getContextualReferenceByName(BeanManagerProvider.getInstance().getBeanManager(), nameFactory
                .generateRoleBeanName(roles[0].name()), GenericRoleVoter.class);
View Full Code Here

                    "Injection points for NamedApplicationRole needs an additional " + config.getNamedPermissionCheck() +
                            " annotation to determine the correct bean");
        }
        NamedRole[] roles = AnnotationUtil.getRoleValues(annotation);
        if (roles.length>1) {
            throw new AmbiguousResolutionException("Only one named role can be specified.");
        }

        return lookup.getRole(roles[0].name());

    }
View Full Code Here

                            " annotation to determine the correct bean"
            );
        }
        NamedPermission[] permissions = AnnotationUtil.getPermissionValues(annotation);
        if (permissions.length > 1) {
            throw new AmbiguousResolutionException("Only one named permission can be specified.");
        }


        return CDIUtil.getContextualReferenceByName(BeanManagerProvider.getInstance().getBeanManager(), nameFactory
                .generatePermissionBeanName(permissions[0].name()), GenericPermissionVoter.class);
View Full Code Here

                            " annotation to determine the correct bean"
            );
        }
        NamedPermission[] permissions = AnnotationUtil.getPermissionValues(annotation);
        if (permissions.length > 1) {
            throw new AmbiguousResolutionException("Only one named permission can be specified.");
        }

        return lookup.getPermission(permissions[0].name());

    }
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

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

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

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

        addBeanInfo(beans, violationMessage);

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

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

        addBeanInfo(beans, violationMessage);

        throw new AmbiguousResolutionException(violationMessage.toString());
    }
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.