Package javax.enterprise.inject

Examples of javax.enterprise.inject.UnsatisfiedResolutionException


      final Set<Bean<?>> beans = beanManager.getBeans(cls);
      if (!beans.isEmpty()) {
         final Bean<?> bean = beanManager.resolve(beans);
         return (T) beanManager.getReference(bean, cls, context);
      }
      throw new UnsatisfiedResolutionException("There is no bean with type '" + cls + "'");
   }
View Full Code Here


    Bean<ElasticsearchOperations> elasticsearchOperationsBean = this.elasticsearchOperationsMap.get(qualifiers
        .toString());

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

    return new ElasticsearchRepositoryBean<T>(elasticsearchOperationsBean, qualifiers, repositoryType, beanManager,
        getCustomImplementationDetector());
View Full Code Here

    // Determine the MongoOperations bean which matches the qualifiers of the repository.
    Bean<MongoOperations> mongoOperations = this.mongoOperations.get(qualifiers);

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

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

        if (injectionPoint != null)
        {
            violationMessage.addLine("for injection into ", injectionPoint.toString());
        }

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

        if (injectionPoint != null)
        {
            violationMessage.addLine("for injection into ", injectionPoint.toString());
        }

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

                }
            }
           
            message.append("]");
           
            throw new UnsatisfiedResolutionException(message.toString());
        }

        if (resolvedSet.size() > 1)
        {
            throw new AmbiguousResolutionException("There is more than one api type with : " + type.getName());
View Full Code Here

            Bean<?> bean = set.iterator().next();
            ProducerMethodBean<?> pr = null;

            if (bean == null || !(bean instanceof ProducerMethodBean))
            {
                throw new UnsatisfiedResolutionException("Producer method component of the disposal method : " + declaredMethod.getName() + " in class : " + clazz.getName() + "is not found");
            }

            else
            {
                pr = (ProducerMethodBean<?>) bean;
View Full Code Here

                Set<Bean<?>> set = InjectionResolver.getInstance().implResolveByType(model.getInjectionGenericType(), bindingAnns);
                producerComponent = (XMLProducerBean<?>) set.iterator().next();

                if (producerComponent == null)
                {
                    throw new UnsatisfiedResolutionException(errorMessage + "Producer method component of the disposal method : " + disposalMethod.getName() + "is not found");
                }

                producerComponent.setDisposalMethod(disposalMethod);

            }
View Full Code Here

      BeanManager beanManager) {

    Bean<GraphDatabase> graphDatabase = this.graphDatabases.get(qualifiers);

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

    return new Neo4jCdiRepositoryBean<T>(graphDatabase, qualifiers, repositoryType, beanManager,
        getCustomImplementationDetector());
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.