Package jodd.petite

Examples of jodd.petite.PetiteException


    this.container = petiteContainer;
    elapsed = System.currentTimeMillis();
    try {
      scanPaths(classpath);
    } catch (Exception ex) {
      throw new PetiteException("Scan classpath error", ex);
    }
    elapsed = System.currentTimeMillis() - elapsed;
    log.info("Petite configured in " + elapsed + " ms. Total beans: " + petiteContainer.getTotalBeans());
  }
View Full Code Here


    }
    Class<?> beanClass;
    try {
      beanClass = loadClass(entryName);
    } catch (ClassNotFoundException cnfex) {
      throw new PetiteException("Unable to load class: " + cnfex, cnfex);
    }
    PetiteBean petiteBean = beanClass.getAnnotation(PetiteBean.class);
    if (petiteBean == null) {
      return;
    }
View Full Code Here

   * Returns request from current thread.
   */
  protected HttpServletRequest getCurrentHttpRequest() {
    HttpServletRequest request = RequestContextListener.getRequest();
    if (request == null) {
      throw new PetiteException("No HTTP request bound to the current thread. Is RequestContextListener registered?");
    }
    return request;
  }
View Full Code Here

   * Returns request from current thread.
   */
  protected HttpSession getCurrentHttpSession() {
    HttpServletRequest request = RequestContextListener.getRequest();
    if (request == null) {
      throw new PetiteException("No HTTP request bound to the current thread. Is RequestContextListener registered?");
    }
    return request.getSession();
  }
View Full Code Here

      PetiteInitMethod petiteInitMethod = method.getAnnotation(PetiteInitMethod.class);
      if (petiteInitMethod == null) {
        continue;
      }
      if (method.getParameterTypes().length > 0) {
        throw new PetiteException("Arguments are not allowed for Petite init method: " + type.getName() + '#' + method.getName());
      }
      int order = petiteInitMethod.order();
      list.add(new InitMethodPoint(method, order, petiteInitMethod.invoke()));
    }
View Full Code Here

      PetiteDestroyMethod petiteDestroyMethod = method.getAnnotation(PetiteDestroyMethod.class);
      if (petiteDestroyMethod == null) {
        continue;
      }
      if (method.getParameterTypes().length > 0) {
        throw new PetiteException("Arguments are not allowed for Petite destroy method: " + type.getName() + '#' + method.getName());
      }
      list.add(new DestroyMethodPoint(method));
    }

    DestroyMethodPoint[] methods;
View Full Code Here

      PetiteInject ref = ctor.getAnnotation(PetiteInject.class);
      if (ref == null) {
        continue;
      }
      if (foundedCtor != null) {
        throw new PetiteException("Two or more constructors are annotated as injection points in bean: " + type.getName());
      }
      foundedCtor = ctor;
      refValues = ref.value().trim();
    }
    if (foundedCtor == null) {
      if (allCtors.length == 1) {
        foundedCtor = allCtors[0].getConstructor();
      } else {
        foundedCtor = defaultCtor;
      }
    }
    if (foundedCtor == null) {
      throw new PetiteException("No constructor (annotated, single or default) founded as injection point for: " + type.getName());
    }

    String[][] references = PetiteUtil.convertAnnValueToReferences(refValues);

    return injectionPointFactory.createCtorInjectionPoint(foundedCtor, references);
View Full Code Here

    elapsed = System.currentTimeMillis();
    try {
      scanPaths(classpath);
    } catch (Exception ex) {
      throw new PetiteException("Scan classpath error", ex);
    }
    elapsed = System.currentTimeMillis() - elapsed;
    log.info("Petite configured in " + elapsed + " ms. Total beans: " + petiteContainer.getTotalBeans());
  }
View Full Code Here

    Class<?> beanClass;

    try {
      beanClass = loadClass(entryName);
    } catch (ClassNotFoundException cnfex) {
      throw new PetiteException("Unable to load class: " + cnfex, cnfex);
    }

    if (beanClass == null) {
      return;
    }
View Full Code Here

TOP

Related Classes of jodd.petite.PetiteException

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.