Package br.gov.frameworkdemoiselle

Examples of br.gov.frameworkdemoiselle.DemoiselleException


          getLogger().info(getBundle().getString("connection-was-closed", key));
        }

      } catch (Exception cause) {
        throw new DemoiselleException(getBundle().getString("connection-close-failed", key), cause);
      }
    }

    cache.clear();
  }
View Full Code Here


      try {
        connection.commit();
        status = getProducer().getStatus(connection);
        status.setActive(false);
      } catch (Exception cause) {
        throw new DemoiselleException(cause);
      }
    }
  }
View Full Code Here

      try {
        connection.rollback();
        status = getProducer().getStatus(connection);
        status.setActive(false);
      } catch (Exception cause) {
        throw new DemoiselleException(cause);
      }
    }
  }
View Full Code Here

    return getRequest().isUserInRole(role);
  }

  @Override
  public boolean hasPermission(String resource, String operation) {
    throw new DemoiselleException(getBundle().getString("has-permission-not-supported",
        RequiredPermission.class.getSimpleName()));
  }
View Full Code Here

   */
  private String getFromXML() {
    Set<String> persistenceUnits = factory.getCache().keySet();

    if (persistenceUnits.size() > 1) {
      throw new DemoiselleException(bundle.getString("more-than-one-persistence-unit-defined",
          Name.class.getSimpleName()));
    } else {
      return persistenceUnits.iterator().next();
    }
  }
View Full Code Here

      for (int index = 0; index < nodes.getLength(); index++) {
        Node node = nodes.item(index);
        persistenceUnit = ((Element) node).getAttribute("name");

        if ("".equals(persistenceUnit)) {
          throw new DemoiselleException(bundle.getString("can-not-get-persistence-unit-from-persistence"));
        } else {
          persistenceUnits.add(persistenceUnit);
        }
      }

      return persistenceUnits.toArray(new String[0]);

    } catch (Exception cause) {
      String message = bundle.getString("can-not-get-persistence-unit-from-persistence");
      logger.error(message, cause);

      throw new DemoiselleException(message, cause);
    }

  }
View Full Code Here

    for (String persistenceUnit : loadPersistenceUnitFromClassloader(contextClassLoader)) {

      try {
        create(persistenceUnit);
      } catch (Exception cause) {
        throw new DemoiselleException(cause);
      }

      logger.debug(bundle.getString("persistence-unit-name-found", persistenceUnit));
    }
  }
View Full Code Here

  protected void handleException(Throwable cause) throws Throwable {
    if (cause instanceof TransactionRequiredException) {
      String message = bundle.get().getString("no-transaction-active", "frameworkdemoiselle.transaction.class",
          Configuration.DEFAULT_RESOURCE);

      throw new DemoiselleException(message, cause);

    } else {
      throw cause;
    }
  }
View Full Code Here

        group = matcher.group(0);
        result = result.replaceFirst(group, "");
      }

    } else {
      throw new DemoiselleException(bundle.get().getString("malformed-jpql"));
    }

    return result;
  }
View Full Code Here

        dataSource.setUrl(url);
        dataSource.setUsername(username);
        dataSource.setPassword(password);

      } catch (ClassCastException cause) {
        throw new DemoiselleException(bundle.getString("load-duplicated-configuration-failed"), cause);
      }

      delegate = dataSource;
    }
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.DemoiselleException

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.