Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoException


        return m;
    }
    private Object treatMapValue(Node node, Object mo) throws SpeedoException {
        SpeedoField f = (SpeedoField) mo;
        if (!(f.jdoTuple instanceof SpeedoMap)) {
            throw new SpeedoException(
                    "Value element must be used for map field only: "
                    + f.getSourceDesc());
        }
        Node n = node.getAttributes().getNamedItem("column");
        if (n != null) {
View Full Code Here


        try {
            compiler.execute();
        } catch (Error e) {
            logger.log(BasicLevel.WARN, "Compilation finished (" + memInfo() + ").");
        } catch (BuildException e) {
            throw new SpeedoException("Error during the compilation", e);
        }
        logger.log(BasicLevel.INFO, "Compilation finished (" + memInfo() + ").");
    }
View Full Code Here

        f.elemType = (String) ((SpeedoMap) sp.jdoTuple).valueType;
        f.keyField = NamingRules.getterName(null,
          sp.getExtensionValueByKey(SpeedoProperties.KEY_FIELD))
          + "()";
      } else {
        throw new SpeedoException(
          "Unmanaged relation with this multivalued field: "
          + sp.jdoTuple);
      }
      if (f.elemType.indexOf('.') == -1) {
        f.elemType = jdoClass.moPackage.name + '.' + f.elemType;
View Full Code Here

    UserFieldMapping ufm = null;
    try {
      ufm = (UserFieldMapping) java.lang.Class.forName(se.value)
        .newInstance();
    } catch (Exception e) {
      throw new SpeedoException(
        "Impossible to instanciate the UserFieldMapping class '"
        + se.value + "' for the field '" + sp.name
        + "' of the class '" + sp.moClass.getFQName() + "':", e);
    }
    if (ufm.getStorageType().isPrimitive()) {
View Full Code Here

    }
 
    public static Mapping getMapping(Class clazz, SpeedoCompilerParameter scp) throws SpeedoException {
    ClassProject cp = clazz.getClassProject(scp.projectName);
    if (cp == null) {
      throw new SpeedoException("No classproject found for the class "
          + clazz.getFQName() + " and  the project " + scp.projectName);
    }
    int idx =  scp.mapperName.indexOf('.');
    Mapping m = cp.getMapping(idx == -1
        ? scp.mapperName
        : scp.mapperName.substring(0, idx));
    if (m == null) {
      throw new SpeedoException("No mapping found for the class "
          + clazz.getFQName() + ",  the project " + scp.projectName
          + " and  the mapper " + scp.mapperName);
    }
    return m;
  }
View Full Code Here

                CLASS_RESOURCE_LOADER_CLASS_VALUE);
        ve.setProperty(Velocity.VM_LIBRARY, strlibs);
        try {
            ve.init();
        } catch (Exception e) {
            throw new SpeedoException(
                    "Impossible to initialize the VelocityEngine", e);
        }

        for (Iterator itDesc = scp.getXmldescriptor().values().iterator(); itDesc.hasNext();) {
            SpeedoXMLDescriptor desc = (SpeedoXMLDescriptor) itDesc.next();
View Full Code Here

        .getNamingfields(jdoClass);
      if (nfs != null) {
        ctx.put("namingFields", nfs);
      }
    } catch (PException e) {
      throw new SpeedoException(
          "Impossible to manage the naming of the class '"
          + jdoClass.getFQName() + "'", e);
    }
   
        //Compute user caches
        Map userCaches = computeUserCaches(jdoClass);
        ctx.put("hasUserCache", Boolean.valueOf(!userCaches.isEmpty()));
        ctx.put("userCacheNames", new ArrayList(userCaches.keySet()));
        for (Iterator iter = userCaches.entrySet().iterator(); iter.hasNext();) {
            Map.Entry me = (Map.Entry) iter.next();
            List fields = (List) me.getValue();
            StringBuffer sb = new StringBuffer();
            if (fields.size() > 1) {
              sb.append("new UserCacheKey(new Object[] {");
            }
            String sep = "";
          for (int j = 0; j < fields.size(); j++) {
              sb.append(sep);
              sep = ", ";
              SpeedoField sf = (SpeedoField) fields.get(j);
              Class clazz;
              try {
                  clazz = Util.getClass(Type.getType(sf.type), null);
              } catch (Exception e1) {
                  throw new SpeedoException("Field '" + sf.name
                           + "' cannot be used in an index: ", e1);
              }
              if (clazz.isPrimitive()) {
                  sb.append("new ").append(getJavaLangType(clazz));
                  sb.append("(").append(sf.name).append(")");
View Full Code Here

                        fields.put(path, qb.project(path, define(qb, path, null)));
                    }
                }
            }
        } catch (Exception e) {
            throw new SpeedoException("Error during the parsing of EJBQL:", e);
        }
    }
View Full Code Here

                }
            if (template == null) {
                  templateFN = templateFN.replace(fs, '/');
                    template = ve.getTemplate(templateFN);
              if (template == null) {
                      throw new SpeedoException("The Speedo template "
                              + templateFN
                              + " is not availlable in the classpath");
          }
        }
          }
View Full Code Here

    //----------------------------------------------------//

    public abstract boolean init() throws SpeedoException;

    public final void process() throws SpeedoException {
        throw new SpeedoException("Do not use this method");
    }
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.