Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoException


                if (tc.next()) {
                    throw new JDOUserException("More than one result in the query");
                }
            }
        } catch (MedorException e) {
            throw new SpeedoException(e);
        } finally {
            close();
        }
      return res;
  }
View Full Code Here


    QueryTree optimizedQT;
    QueryEvaluator evaluator;
   
    public synchronized void compile() throws SpeedoException, MedorException, ExpressionException {
        if (status == UNDEFINED)
            throw new SpeedoException("Impossible to compile an undefined query");
        if (status == COMPILED)
            return;
        long timeToCompile = System.currentTimeMillis();
        boolean debug = logger.isLoggable(BasicLevel.DEBUG);
        // create a speedoQL object with a filter string
        String filter = qd.filter;
        filter = '(' + filter + ')';
        // create representations of the parameters list and the variable
        // list
        toHashtableParams(qd.parameters, ";,");
        toHashtableVars(qd.variables, ";,");
        Manager miManager = mapper.getMetaInfoManager();
        if (miManager == null)
            throw new SpeedoException(
                    "A non null Meta information manager is needed");
        try {
            jf.getPClassMapping(
                    qd.candidateClass.getName(),
                    classLoader);
        } catch (Exception e) {
            throw new SpeedoException(e);
        }
        SimpleNode node = null;
        try {
            node = new SpeedoQL(new CharArrayReader(filter.toCharArray())).SpeedoQL();
        } catch (ParseException e) {
            throw new SpeedoException(
                    "Impossible to parse the filter and to create AST", e);
        }
        SpeedoQLVariableVisitor sqvv = new SpeedoQLVariableVisitor(
                node, miManager, varParserlogger, hparams, hvars, qd.order,
                qd.candidateClass.getName(), qd.includeSubClasses);
View Full Code Here

     * @see #columns
     */
    public void setColumns(List columns) throws SpeedoException {
        switch (strategy) {
        case NO_ID:
            throw new SpeedoException("No identifier strategy defined !");
        case USER_ID:
            throw new SpeedoException("Application identifier cannot have hidden column(s): " + columns);
        case DATASTORE_LONG:
            setNoFieldColumn(columns, new Class[]{Long.TYPE});
            break;
        case DATASTORE_OLONG:
        case DATASTORE_SEQUENCE:
View Full Code Here

      } else if (CACHE_REPLCAEMENT_MRU.equalsIgnoreCase(policy)) {
        tempName = "org.objectweb.perseus.cache.replacement.lib.MRUReplacementManager";
      } else if (CACHE_REPLCAEMENT_FIFO.equalsIgnoreCase(policy)) {
        tempName = "org.objectweb.perseus.cache.replacement.lib.FIFOReplacementManager";
      } else {
        logger.log(BasicLevel.ERROR, new SpeedoException(
            "Unmanaged cache replacement policy: " + policy));
      }
      if (tempName != null) {
        //unbind the rm from the composite
        Fractal.getBindingController(cm).unbindFc("replacement-manager");
View Full Code Here

      //There is a connection factory
      try {
        InitialContext ic = new InitialContext();
        cf = ic.lookup(cfName);
      } catch (NamingException e) {
        throw new SpeedoException(
            "Problem to get the connection factory in JNDI ("
            + cfName + ")", e);
      }
      if (cf == null) {
        throw new SpeedoException(
            "No connection factory registered in JNDI with the name "
            + cfName);
      } else if (cf instanceof ConnectionSpecJDBC) {
        // Use the JDBC Mapper ==> nothing to do
      } else if (cf instanceof javax.sql.DataSource) {
        // Use the JDBC Mapper ==> nothing to do
      } else if (cf instanceof javax.resource.cci.ConnectionFactory) {
        throw new SpeedoException("JCA datasource no yet supported");
      } else {
        throw new SpeedoException("The connection factory registered "
            + "in JNDI is not supported by Speedo " + cfName + " => "
            + cf);
      }
      boolean ignoring = removeProps(props, new String[]{
              JDO_OPTION_CONNECTION_DRIVER_NAME_OLD,
View Full Code Here

     * application staregy choosen, ...)
     * @see #columns
     */
    private void setNoFieldColumn(List cols, Class[] memoryTypes) throws SpeedoException {
        if (cols.size() != memoryTypes.length) {
            throw new SpeedoException("The identity strategy '"
                    + getStrategyName(strategy) + "' requires "
                    + memoryTypes.length + " column(s): " + columns);
        }
        SpeedoNoFieldColumn[] nfcs = new SpeedoNoFieldColumn[cols.size()];
        for (int i = 0; i < nfcs.length; i++) {
View Full Code Here

        for(int i=0; i<namingManagers.length; i++) {
            if (namingManagers[i].canManage(sc)) {
                return namingManagers[i];
            }
        }
        throw new SpeedoException("No identity manager found for the class '"
                + sc.getFQName() + "', " + sc.getIdentityType() + ", " +
                sc.getExtension(SpeedoProperties.VENDOR_NAME, SpeedoProperties.ID));
    }
View Full Code Here

                    val =
                        jf.getPClassMapping(
                        (Class) paramName2paramClass.get(po.getName()))
                        .getPBinder().getNull();
                } catch (Exception e) {
                    throw new SpeedoException(
                        "Impossible to find the null PName of the parameter (name= "
                        + po.getName()
                        + " / type= " + po.getType().getJormName(),
                        e);
                }
View Full Code Here

          //use a kfpnc
          pncClassName = NamingRules.kfpncName(ancestor.getFQName());
        }
      } catch (Exception e) {
        logger.log(BasicLevel.ERROR, "Error while retrieving the inheritance filter of the namedef:" + nd.toString());
        throw new SpeedoException("Error while retrieving the inheritance filter of the namedef:" + nd.toString(), e);
      }
    } else {
      ancestorClassName = targetClass.getFQName();
      pncClassName = SPEEDO_BINDER_CLASS_NAME;
    }
View Full Code Here

            mibh.createNameDefField(jc, fieldName, PTypeSpace.OBJLONG);
        } else {
            String type = pkField.type();
      if (!"java.lang.Long".equals(type) && !"Long".equals(type)
                    && !"long".equals(type)) {
                throw new SpeedoException(
                        "Impossible to use an auto incremented identifier: " +
                        "the field type of '" + pkField.name + "' is '" + pkField.type()
                        + "' and 'java.lang.Long' or long is expected (class '"
                        + sc.getFQName() + "'.");
            }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.api.SpeedoException

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.