Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoException


            visit(speedoql);
        } catch (Exception e) {
            if (e instanceof SpeedoQLAbstractVisitor.VisitorException) {
                e = ((SpeedoQLAbstractVisitor.VisitorException) e).getNestedException();
            }
            throw new SpeedoException(
                    "Impossible to built the queryTree during the filter visit", e);
        }
        // this expression is the filter of the SelectProject
        Expression exprFilter = getQueryFilter();
        if (exprFilter != null) {
View Full Code Here


            if (ptype.getTypeCode() == PType.TYPECODE_REFERENCE) {
              PName val = null;
              try {
                val = jf.getPClassMapping(ptype.getJormName(), clazz.getClassLoader()).getPBinder().getNull();
              } catch (Exception e) {
                throw new SpeedoException(
                    "Try to replace null node. Impossible to find the null PName for the type " + ptype.getJormName(), e);
              }
              //replace the null node with null PName
              op.setExpression(i, new BasicOperand(val, ptype));
            } else {
View Full Code Here

            if (debug) {
                logger.log(BasicLevel.DEBUG, tab + "create a fieldOperand with:" + name);
            }
        Field f = (Field) fields.get(name);
        if (f == null) {
            throw new SpeedoException("Internal error: No field '" + name + "' found during filter parsing");
        }
        stack.push(new BasicFieldOperand(f));
            return;
        }
        //There is an operator
View Full Code Here

        try {
            FileOutputStream fos = new FileOutputStream(fileName);
            fos.write(cv.toByteArray());
            fos.close();
        } catch (Exception e) {
            throw new SpeedoException("Problem while generating PAccessor.", e);
        }
    }
View Full Code Here

                gcm = getMapping(klass).getGenClassMapping(gcid);
                superclasses = klass.getSuperClasses();
            }
        }
        if (gcm == null) {
            throw new SpeedoException("No GenClassMapping found for the field "
                    + gcid);
        }
        return gcm;
    }
View Full Code Here

                        rid);
                superclasses = klass.getSuperClasses();
            }
        }
        if (rm == null) {
            throw new SpeedoException(
                    "No ReferenceMapping found for the field " + rid);
        }
        return rm;

    }
View Full Code Here

   
  public boolean init() throws SpeedoException {
    super.init();
    output = new File(scp.output);
    if (!output.exists() && output.mkdirs()) {
      throw new SpeedoException(
          "Impossible to create the output directory: "
          + output.getAbsolutePath());
    }
    input = new File(scp.input);
    if (!input.exists()) {
      throw new SpeedoException("No input directory: "
          + input.getAbsolutePath());
    }
    try {
      classloader = new URLClassLoader(
          new URL[]{new File(scp.output).toURL()},
View Full Code Here

      if (debug) {
        logger.log(BasicLevel.DEBUG, "Removing the jmi file:"
            + jmiFile.getAbsolutePath());
      }
      if (jmiFile.exists() && !jmiFile.delete()) {
        throw new SpeedoException(
            "Impossible to remove the JMI file associated to the jdo file:"
            + xml.xmlFile);
      }

      for (int i = (enhancedClasses.size() - 1); i >= 0; i--) {
        SpeedoClass sc = (SpeedoClass) enhancedClasses.get(i);
        String baseName = StringReplace.replaceChar(
            '.', File.separatorChar, sc.getFQName());
        File classFile = new File(output, baseName + ".class");
        if (debug) {
          logger.log(BasicLevel.DEBUG, "Removing class files:" + classFile);
        }
        if (classFile.exists() && !classFile.delete()) {
          throw new SpeedoException("Impossible to remove the file:"
              + classFile.getAbsolutePath());
        }
      }
    } else {
      if (xmlsToRemove == null) {
View Full Code Here

        } catch (ClassFormatError e) {
          logger.log(BasicLevel.DEBUG, "Class " + sc.getFQName(), e);
        } catch (Throwable e) {
          String msg = "Impossible to analyze the class '" + sc.getFQName() + "': ";
          logger.log(BasicLevel.ERROR, msg, e);
          throw new SpeedoException(msg);
        }
        if (debug) {
          logger.log(BasicLevel.DEBUG, "The class " + sc.getFQName()
              + " is "
              (sc.isAlreadyEnhanced() ? "": "not ")
              + "already enhanced.");
        }
      }
    }
    if (classExist && javaModified) {
      logger.log(BasicLevel.INFO, "The class " + sc.getFQName() + " has been modified (Remove the .class).");
      if (!classFile.delete()) {
          throw new SpeedoException("Impossible to remove the file:"
              + classFile.getAbsolutePath());
      }
    }
    sc.setRequireEnhancement(!classExist || javaModified || !sc.isAlreadyEnhanced());
    if (!sc.requireEnhancement()) {
View Full Code Here

            if (f.columns != null && f.columns.length > 0) {
                col.table = f.columns[0].table;
            }
        }
        if (!(f.jdoTuple instanceof SpeedoMap)) {
            throw new SpeedoException(
                    "key element must be used for map field only: "
                    + f.getSourceDesc());
        }
        SpeedoMap m = (SpeedoMap) f.jdoTuple;
        if (col != null) {
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.