Package br.gov.frameworkdemoiselle

Examples of br.gov.frameworkdemoiselle.DemoiselleException


   */
  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);
        }
        // logger.debug(bundle.getString("persistence-unit-name-found",
        // 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

  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

      }

      return query;

    } else {
      throw new DemoiselleException(bundle.get().getString("malformed-jpql"));
    }
  }
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

    if (processors.isEmpty()) {
      unloadTempContexts();
    }

    if (failure != null) {
      throw new DemoiselleException(failure);
    }
  }
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.