Examples of InstantiateException


Examples of com.im.imjutil.exception.InstantiateException

  public HashCipher(CipherType type) {
    this.type = type;
    try {
      messageDigest = MessageDigest.getInstance(type.cipher);
    } catch (NoSuchAlgorithmException e) {
      throw new InstantiateException(Convert.toString(
          "Algoritmo nao suportado [", type.cipher, "]"), e);
    }
  }
View Full Code Here

Examples of com.im.imjutil.exception.InstantiateException

   * do tipo {@link CipherType}.
   */
  public static final Cipher getInstance(CipherType type)
      throws InstantiateException {
    if (type == null) {
      throw new InstantiateException("O tipo passado e nulo");
    }
   
    Class<? extends Cipher> clazz = type.clazz;

    if (clazz == null) {
      throw new InstantiateException(Convert.toString(
          "Tipo de codificador nao implementado: ", type.cipher));
    }
   
    Cipher instance = null;
   
    try {
      try {
        Constructor<? extends Cipher> constructor;
        constructor = clazz.getConstructor(CipherType.class);
        instance = constructor.newInstance(type);
       
      } catch (NoSuchMethodException e) {
        instance = clazz.newInstance();
      }
    } catch (java.lang.InstantiationException e) {
      throw new InstantiateException("Erro ao instanciar o codificador",e);
     
    } catch (IllegalAccessException e) {
      throw new InstantiateException("Erro ao acessar o codificador",e);
     
    } catch (InvocationTargetException e) {
      throw new InstantiateException("Erro ao construir o codificador",e);
     
    } catch (Exception e) {
      throw new InstantiateException(Convert.toString(
          "Excecao desconhecida: ", e.getClass().getName(),
          " -> ", e.getMessage()), e);
    }
    return instance;
  }
View Full Code Here

Examples of org.restlet.ext.jaxrs.InstantiateException

        final ResourceObject rootResourceObject;
        rootResourceObject = new ResourceObject(instance, this);
        try {
            this.injectHelper.injectInto(instance, true);
        } catch (InjectException e) {
            throw new InstantiateException(e);
        }
        return rootResourceObject;
    }
View Full Code Here

Examples of org.restlet.ext.jaxrs.InstantiateException

            Object... args) throws InvocationTargetException,
            InstantiateException {
        try {
            return constructor.newInstance(args);
        } catch (IllegalArgumentException e) {
            throw new InstantiateException("Could not instantiate "
                    + constructor.getDeclaringClass(), e);
        } catch (InstantiationException e) {
            throw new InstantiateException("Could not instantiate "
                    + constructor.getDeclaringClass(), e);
        } catch (IllegalAccessException e) {
            throw new InstantiateException("Could not instantiate "
                    + constructor.getDeclaringClass(), e);
        }
    }
View Full Code Here

Examples of org.restlet.ext.jaxrs.InstantiateException

            IllegalArgumentException, MissingAnnotationException {
        Object subResObj;
        try {
            subResObj = internalInvoke(resourceObject);
        } catch (IllegalArgumentException e) {
            throw new InstantiateException(this.executeMethod, e);
        } catch (IllegalAccessException e) {
            throw new InstantiateException(this.executeMethod, e);
        }
        if (subResObj == null) {
            logger
                    .warning("The sub resource object is null. That is not allowed");
            final ResponseBuilder rb = javax.ws.rs.core.Response.serverError();
View Full Code Here

Examples of org.restlet.ext.jaxrs.InstantiateException

  {
    if (classesToComponents.containsKey(jaxRsClass)) {
      return (T) classesToComponents.get(jaxRsClass);
    }

    throw new InstantiateException("JsrComponent of class '" + jaxRsClass.getName() + "' not found!");
  }
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.