Package br.gov.frameworkdemoiselle

Examples of br.gov.frameworkdemoiselle.DemoiselleException


        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


    try {
      Context context = new InitialContext();
      result = (DataSource) context.lookup(jndi);

    } catch (NamingException cause) {
      throw new DemoiselleException(bundle.getString("load-jndi-datasource-failed", dataSourceName), cause);

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

    return result;
  }
View Full Code Here

    ResourceBundle bundle = ResourceBundleProducer.create("demoiselle-core-bundle", Locale.getDefault());

    Management monitoringManager = Beans.getReference(Management.class);
    for (AnnotatedType<?> type : types) {
      if (type.getJavaClass().isInterface() || Modifier.isAbstract(type.getJavaClass().getModifiers())) {
        throw new DemoiselleException(bundle.getString("management-abstract-class-defined", type.getJavaClass()
            .getCanonicalName()));
      }

      ManagedType managedType = new ManagedType(type.getJavaClass());
      monitoringManager.addManagedType(managedType);
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

        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

    if (!ambiguous.isEmpty()) {
      ambiguous.add(selected);

      String message = getExceptionMessage(type, ambiguous);
      throw new DemoiselleException(message, new AmbiguousResolutionException());
    }
  }
View Full Code Here

  public boolean hasPermission(String resource, String operation) {
    throw getException();
  }

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

  public ManagedType(Class<?> type) {
    bundle = ResourceBundleProducer.create("demoiselle-core-bundle");

    if (type == null) {
      throw new DemoiselleException(bundle.getString("management-null-class-defined"));
    }
    if (!type.isAnnotationPresent(ManagementController.class)) {
      throw new DemoiselleException(bundle.getString("management-no-annotation-found", type.getCanonicalName()));
    }

    this.type = type;
    fields = new TreeMap<String, FieldDetail>();
    operationMethods = new TreeMap<String, MethodDetail>();
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.