Examples of Errors


Examples of com.datastax.driver.core.Metrics.Errors

        // We only have one node, this will throw an unavailable exception
        Statement statement = new SimpleStatement("SELECT v FROM test WHERE k = 1").setConsistencyLevel(ConsistencyLevel.TWO);
        session.execute(statement);

        Errors errors = cluster.getMetrics().getErrorMetrics();
        assertEquals(errors.getUnavailables().getCount(), 1);
        assertEquals(errors.getRetries().getCount(), 1);
        assertEquals(errors.getRetriesOnUnavailable().getCount(), 1);

        retryDecision = RetryDecision.ignore();
        session.execute(statement);

        assertEquals(errors.getUnavailables().getCount(), 2);
        assertEquals(errors.getIgnores().getCount(), 1);
        assertEquals(errors.getIgnoresOnUnavailable().getCount(), 1);
    }
View Full Code Here

Examples of com.google.inject.internal.Errors

    this.declaringType = declaringType;
    this.optional = optional;

    Annotation[] annotations = field.getAnnotations();

    Errors errors = new Errors(field);
    Key<?> key = null;
    try {
      key = Annotations.getKey(declaringType.getFieldType(field), field, annotations, errors);
    } catch (ConfigurationException e) {
      errors.merge(e.getErrorMessages());
    } catch (ErrorsException e) {
      errors.merge(e.getErrors());
    }
    errors.throwConfigurationExceptionIfErrorsExist();

    this.dependencies = ImmutableList.<Dependency<?>>of(
        newDependency(key, Nullability.allowsNull(annotations), -1));
  }
View Full Code Here

Examples of com.google.inject.internal.Errors

        newDependency(key, Nullability.allowsNull(annotations), -1));
  }

  private ImmutableList<Dependency<?>> forMember(Member member, TypeLiteral<?> type,
      Annotation[][] paramterAnnotations) {
    Errors errors = new Errors(member);
    Iterator<Annotation[]> annotationsIterator = Arrays.asList(paramterAnnotations).iterator();

    List<Dependency<?>> dependencies = Lists.newArrayList();
    int index = 0;

    for (TypeLiteral<?> parameterType : type.getParameterTypes(member)) {
      try {
        Annotation[] parameterAnnotations = annotationsIterator.next();
        Key<?> key = Annotations.getKey(parameterType, member, parameterAnnotations, errors);
        dependencies.add(newDependency(key, Nullability.allowsNull(parameterAnnotations), index));
        index++;
      } catch (ConfigurationException e) {
        errors.merge(e.getErrorMessages());
      } catch (ErrorsException e) {
        errors.merge(e.getErrors());
      }
    }

    errors.throwConfigurationExceptionIfErrorsExist();
    return ImmutableList.copyOf(dependencies);
  }
View Full Code Here

Examples of com.google.inject.internal.Errors

   * @since 3.0
   */
  public static <T> InjectionPoint forConstructor(
      Constructor<T> constructor, TypeLiteral<? extends T> type) {
    if (type.getRawType() != constructor.getDeclaringClass()) {
      new Errors(type)
          .constructorNotDefinedByType(constructor, type)
          .throwConfigurationExceptionIfErrorsExist();
    }

    return new InjectionPoint(type, constructor);
View Full Code Here

Examples of com.google.inject.internal.Errors

   *     constructor, or if parameters of the injectable constructor are malformed, such as a
   *     parameter with multiple binding annotations.
   */
  public static InjectionPoint forConstructorOf(TypeLiteral<?> type) {
    Class<?> rawType = getRawType(type.getType());
    Errors errors = new Errors(rawType);

    Constructor<?> injectableConstructor = null;
    for (Constructor<?> constructor : rawType.getDeclaredConstructors()) {

      boolean optional;
      Inject guiceInject = constructor.getAnnotation(Inject.class);
      if (guiceInject == null) {
        javax.inject.Inject javaxInject = constructor.getAnnotation(javax.inject.Inject.class);
        if (javaxInject == null) {
          continue;
        }
        optional = false;
      } else {
        optional = guiceInject.optional();
      }

      if (optional) {
        errors.optionalConstructor(constructor);
      }

      if (injectableConstructor != null) {
        errors.tooManyConstructors(rawType);
      }

      injectableConstructor = constructor;
      checkForMisplacedBindingAnnotations(injectableConstructor, errors);
    }

    errors.throwConfigurationExceptionIfErrorsExist();

    if (injectableConstructor != null) {
      return new InjectionPoint(type, injectableConstructor);
    }

    // If no annotated constructor is found, look for a no-arg constructor instead.
    try {
      Constructor<?> noArgConstructor = rawType.getDeclaredConstructor();

      // Disallow private constructors on non-private classes (unless they have @Inject)
      if (Modifier.isPrivate(noArgConstructor.getModifiers())
          && !Modifier.isPrivate(rawType.getModifiers())) {
        errors.missingConstructor(rawType);
        throw new ConfigurationException(errors.getMessages());
      }

      checkForMisplacedBindingAnnotations(noArgConstructor, errors);
      return new InjectionPoint(type, noArgConstructor);
    } catch (NoSuchMethodException e) {
      errors.missingConstructor(rawType);
      throw new ConfigurationException(errors.getMessages());
    }
  }
View Full Code Here

Examples of com.google.inject.internal.Errors

   *      a field with multiple binding annotations. The exception's {@link
   *      ConfigurationException#getPartialValue() partial value} is a {@code Set<InjectionPoint>}
   *      of the valid injection points.
   */
  public static Set<InjectionPoint> forStaticMethodsAndFields(TypeLiteral<?> type) {
    Errors errors = new Errors();
   
    Set<InjectionPoint> result;
   
    if (type.getRawType().isInterface()) {
      errors.staticInjectionOnInterface(type.getRawType());
      result = null;
    } else {
      result = getInjectionPoints(type, true, errors);
    }
   
    if (errors.hasErrors()) {
      throw new ConfigurationException(errors.getMessages()).withPartialValue(result);
    }
    return result;
  }
View Full Code Here

Examples of com.skyline.common.validation.Errors

   *            需要验证的Bean或者Map或者String
   * @return 如果不空表示校验不通过,在调用后必须调用{@link BaseController#processValidationErrors(String, String, ModelAndView)}
   *
   * */
  protected <T> String validateForm(String formName, T bean) {
    Errors errors = ValidationUtils.validateForm(formName, bean);
    String[] errorMsgs = ValidationUtils.getAllErrorMessages(errors);
    if (errorMsgs.length < 1) {
      return null;
    } else {
      return errorMsgs[0];
View Full Code Here

Examples of eu.admire.gateway.common.errors.Errors

                    {
                        while (!remote.getStatus().isDone())
                        {
                            Thread.sleep(1000);
                        }
                        Errors errors = remote.getErrors();
                        // we're not handling compile time errors
                        // because they would have occurred before this method is reached
                        if (errors.getRuntime() != null)
                        {
                            ErrorHelper.getRuntimeInstance(mErrors).getProcessingElement().addAll(
                                    errors.getRuntime().getProcessingElement());
                        }
                        if (errors.getSystem() != null)
                        {
                            mErrors.setSystem(errors.getSystem());
                        }
                        return !remote.getStatus().isError();
                    }
                    finally
                    {
View Full Code Here

Examples of net.mlw.vlh.Errors

               }

            }
            else
            {
               Errors errors = new Errors();
               for (Iterator iter = filterRetrievers.iterator(); iter.hasNext();)
               {
                  FilterRetriever element = (FilterRetriever) iter.next();
                  String key = element.getFilterKey();
                  Object value = element.getFilterValue(errors);
                  info.getFilters().put(key, value);
               }

               if (errors.hasErrors())
               {
                  if (errorListener != null)
                  {
                     errorListener.actionPerformed(new ActionEvent(errors, 0, "errors"));
                     return;
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.validation.Errors

     */
    public Errors validate(final Object object) {

        Iteration iteration = (Iteration) object;

        Errors errors = AgilePlanningObjectFactory.getErrors();

        // la date de d�but est obligatoire
        if (iteration.getStart() == null) {

            errors.rejectValue(IterationValidator.FIELD_START,
                    "iteration.startMandatory");

        }

        // la date de fin est obligatoire
        if (iteration.getEnd() == null) {

            errors.rejectValue(IterationValidator.FIELD_END,
                    "iteration.endMandatory");

        }

        if (iteration.getStart() != null && iteration.getEnd() != null) {

            Calendar start = Calendar.getInstance();
            start.setTime(iteration.getStart());
            Calendar end = Calendar.getInstance();
            end.setTime(iteration.getEnd());

            if (end.compareTo(start) < 0) {

                errors.reject("iteration.incoherentDate");

            }

        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.