Package javax.enterprise.inject

Examples of javax.enterprise.inject.UnsatisfiedResolutionException


        return new DependentInstance<T>(getCurrentManager(), beanType, qualifiers);
    }

    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


        return (T) manager.getReference(bean, beanType.getType(), manager.createCreationalContext(bean));
    }

    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

        return OldSPIBridge.getInstanceByName(getCurrentManager(), name);
    }

    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

    // Determine the entity manager bean which matches the qualifiers of the repository.
    Bean<EntityManager> entityManagerBean = entityManagers.get(qualifiers);

    if (entityManagerBean == null) {
      throw new UnsatisfiedResolutionException(String.format("Unable to resolve a bean for '%s' with qualifiers %s.",
          EntityManager.class.getName(), qualifiers));
    }

    // Construct and return the repository bean.
    return new JpaRepositoryBean<T>(beanManager, entityManagerBean, qualifiers, repositoryType,
View Full Code Here

    private static Set<Bean<?>> getBeans(BeanManager beanManager, Type beanType, Annotation... qualifiers) {

        Set<Bean<?>> beans = beanManager.getBeans(beanType, qualifiers);

        if (beans == null || beans.isEmpty()) {
            throw new UnsatisfiedResolutionException(String.format(
                    "No bean matches required type %s and required qualifiers %s", beanType, Arrays.toString(qualifiers)));
        }
        return beans;
    }
View Full Code Here

        return new DependentInstance<T>(getCurrentManager(), beanType, qualifiers);
    }

    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

        return new DependentInstance<T>(getCurrentManager(), beanType, qualifiers);
    }

    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 DependentInstance(BeanManager beanManager, Class<T> beanType, Annotation... qualifiers) {

        Set<Bean<?>> beans = beanManager.getBeans(beanType, qualifiers);

        if (beans == null || beans.isEmpty()) {
            throw new UnsatisfiedResolutionException(String.format(
                    "No bean matches required type %s and required qualifiers %s", beanType, Arrays.toString(qualifiers)));
        }

        bean = (Bean<T>) beanManager.resolve(beans);
View Full Code Here

    private static Set<Bean<?>> getBeans(BeanManager beanManager, Type beanType, Annotation... qualifiers) {

        Set<Bean<?>> beans = beanManager.getBeans(beanType, qualifiers);

        if (beans == null || beans.isEmpty()) {
            throw new UnsatisfiedResolutionException(String.format(
                    "No bean matches required type %s and required qualifiers %s", beanType, Arrays.toString(qualifiers)));
        }
        return beans;
    }
View Full Code Here

                log.warn("RDF repository has already been initialized");
            }

            if(storeProviders.isUnsatisfied()) {
                log.error("no storage backend found in classpath; please add one of the marmotta-backend-XXX modules");
                throw new UnsatisfiedResolutionException("no storage backend found in classpath; please add one of the marmotta-backend-XXX modules");
            }

            if(storeProviders.isAmbiguous()) {
                log.warn("more than one storage backend in classpath, trying to select the most appropriate ...");
                StoreProvider candidate = null;
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.UnsatisfiedResolutionException

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.