Package br.gov.frameworkdemoiselle

Examples of br.gov.frameworkdemoiselle.DemoiselleException


        buffer.append(", ");
        buffer.append(qualifier.getClass().getCanonicalName());
      }

      String message = getBundle().getString("bean-not-found", buffer.toString());
      throw new DemoiselleException(message, cause);
    }

    return instance;
  }
View Full Code Here


    try {
      instance = (T) getReference(manager.getBeans(beanClass), beanClass);

    } catch (NoSuchElementException cause) {
      String message = getBundle().getString("bean-not-found", beanClass.getCanonicalName());
      throw new DemoiselleException(message, cause);
    }

    return instance;
  }
View Full Code Here

    try {
      instance = (T) getReference(manager.getBeans(beanName));

    } catch (NoSuchElementException cause) {
      String message = getBundle().getString("bean-not-found", beanName);
      throw new DemoiselleException(message, cause);
    }

    return instance;
  }
View Full Code Here

      ContextManager.deactivate(ThreadLocalContext.class, ConversationScoped.class);
      ContextManager.deactivate(ThreadLocalContext.class, RequestScoped.class);
    }

    if (failure != null) {
      throw new DemoiselleException(failure);
    }
  }
View Full Code Here

  public void setRollbackOnly() {
    throw getException();
  }

  private DemoiselleException getException() {
    return new DemoiselleException(getBundle().getString("transaction-not-defined",
        Transactional.class.getSimpleName()));
  }
View Full Code Here

   *             if there is no managed context of the provided type and scope.
   */
  public static synchronized void activate(Class<? extends CustomContext> customContextClass,
      Class<? extends Annotation> scope) {
    if (!initialized) {
      throw new DemoiselleException(getBundle().getString("custom-context-manager-not-initialized"));
    }

    for (CustomContextCounter context : contexts) {
      if (context.isSame(customContextClass, scope)) {
        context.activate();
        return;
      }
    }

    throw new DemoiselleException(getBundle().getString("custom-context-not-found",
        customContextClass.getCanonicalName(), scope.getSimpleName()));
  }
View Full Code Here

   *             if there is no managed context of the provided type and scope.
   */
  public static synchronized void deactivate(Class<? extends CustomContext> customContextClass,
      Class<? extends Annotation> scope) {
    if (!initialized) {
      throw new DemoiselleException(getBundle().getString("custom-context-manager-not-initialized"));
    }

    for (CustomContextCounter context : contexts) {
      if (context.isSame(customContextClass, scope)) {
        context.deactivate();
        return;
      }
    }

    throw new DemoiselleException(getBundle().getString("custom-context-not-found",
        customContextClass.getCanonicalName(), scope.getSimpleName()));
  }
View Full Code Here

   * @deprecated Use {@link #getCurrentUser()} instead.
   * @see br.gov.frameworkdemoiselle.security.SecurityContext#getUser()
   */
  @Override
  public User getUser() {
    throw new DemoiselleException("Utilize o método getCurrentUser() ao invés do getUser()");
  }
View Full Code Here

  public DummyEntity insert(DummyEntity bean) {

    if (this.entities.add(bean)) {
      return bean;
    } else {
      throw new DemoiselleException("Erro ao inserir entity");
    }

  }
View Full Code Here

    em2.flush();
   
    em1.clear();
    em2.clear();

    throw new DemoiselleException("Forçando rollback");
  }
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.