Package br.gov.frameworkdemoiselle.exception

Examples of br.gov.frameworkdemoiselle.exception.ApplicationException


  private void handleException(final Exception cause) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();

    if (!transaction.isMarkedRollback()) {
      boolean rollback = false;
      ApplicationException annotation = cause.getClass().getAnnotation(ApplicationException.class);

      if (annotation == null || annotation.rollback()) {
        rollback = true;
      }

      if (rollback) {
        transaction.setRollbackOnly();
View Full Code Here


    return true;
  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  private void handleException(final Exception cause) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();

    if (!transaction.isMarkedRollback()) {
      boolean rollback = false;
      ApplicationException annotation = cause.getClass().getAnnotation(ApplicationException.class);

      if (annotation == null || annotation.rollback()) {
        rollback = true;
      }

      if (rollback) {
        transaction.setRollbackOnly();
View Full Code Here

    return true;
  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

    return true;
  }

  private void handleException(Throwable cause) throws Throwable {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw cause;

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  private void handleException(final Exception cause) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();

    if (!transaction.isMarkedRollback()) {
      boolean rollback = false;
      ApplicationException annotation = cause.getClass().getAnnotation(ApplicationException.class);

      if (annotation == null || annotation.rollback()) {
        rollback = true;
      }

      if (rollback) {
        transaction.setRollbackOnly();
View Full Code Here

    return result;
  }

  public static FacesMessage parse(final Throwable throwable) {
    FacesMessage facesMessage = new FacesMessage();
    ApplicationException annotation = throwable.getClass().getAnnotation(ApplicationException.class);

    if (annotation != null) {
      facesMessage.setSeverity(parse(annotation.severity()));
    } else {
      facesMessage.setSeverity(SEVERITY_ERROR);
    }

    if (throwable.getMessage() != null) {
View Full Code Here

    return result;
  }

  public static FacesMessage parse(final Throwable throwable) {
    FacesMessage facesMessage = new FacesMessage();
    ApplicationException annotation = throwable.getClass().getAnnotation(ApplicationException.class);

    if (annotation != null) {
      facesMessage.setSeverity(parse(annotation.severity()));
    } else {
      facesMessage.setSeverity(SEVERITY_ERROR);
    }

    if (throwable.getMessage() != null) {
View Full Code Here

    return true;
  }

  private void handleException(Throwable cause) throws Exception {
    ApplicationException ann = cause.getClass().getAnnotation(ApplicationException.class);

    if (ann == null || SeverityType.FATAL == ann.severity()) {
      throw (cause instanceof Exception ? (Exception) cause : new Exception(cause));

    } else {
      switch (ann.severity()) {
        case INFO:
          getLogger().info(cause.getMessage());
          break;

        case WARN:
View Full Code Here

  private void handleException(final Exception cause) {
    Transaction transaction = getTransactionContext().getCurrentTransaction();

    if (!transaction.isMarkedRollback()) {
      boolean rollback = false;
      ApplicationException annotation = cause.getClass().getAnnotation(ApplicationException.class);

      if (annotation == null || annotation.rollback()) {
        rollback = true;
      }

      if (rollback) {
        transaction.setRollbackOnly();
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.exception.ApplicationException

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.