Examples of RuleDefinition


Examples of org.dmd.dms.RuleDefinition

    }
   
    Iterator<RuleDefinition> rules = schema.getRuleDefinitionList();
    if (rules != null){
      while(rules.hasNext()){
        RuleDefinition rd = rules.next();
        sb.append("    public static RuleDefinition _" + rd.getName() + ";\n");
        allVars.add(new VarToObject("_" + rd.getName(), rd, "RuleDefinition"));
        ruleVars.add(new VarToObject("_" + rd.getName(), rd, "RuleDefinition"));
      }
      sb.append("\n");
      allVars.add(new VarToObject("", null, null));
    }
   
View Full Code Here

Examples of org.dmd.dms.RuleDefinition

            Iterator<DmcUncheckedObject> ucoIT = curr.getParsedRules();
            if (ucoIT != null){
          while(ucoIT.hasNext()){
            DmcUncheckedObject   uco = ucoIT.next();
            ClassDefinition   ruleDataCD   = sm.cdef(uco.getConstructionClass());
            RuleDefinition    ruleDEF    = ruleDataCD.getRuleDefinition();
            RuleDataDMO     ruledata  = null;
            SourceInfo      source    = getSource(uco);
           
            try{
              ruledata = (RuleDataDMO) dmofactory.createObject(uco);
//              DebugInfo.debug("Parsed and instantiated:\n\n" + ruledata.toOIF());
            }
            catch(ClassNotFoundException cnf){
              // This may be thrown from TypeDefinition when trying to instantiate a
              // holder for an attribute. This would likely result from not having
              // the compiled output of a previous code generation run specified on
              // the class path for the dmogen call that's checking the rules
              StringBuffer sb = new StringBuffer();
              sb.append(cnf.getMessage() + "\n\n");
              sb.append("You probably need to augment the following classpath:\n");
              ClassLoader cl = ClassLoader.getSystemClassLoader();
                  URL[] urls = ((URLClassLoader)cl).getURLs();
                  for(URL url: urls){
                    sb.append(url.getFile() + "\n");
                  }
                  sb.append("\nwith the classpath info for the missing class.");

              DmcRuleException ex = new DmcRuleException(sb.toString(), null);
              ex.source(source);
             
              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex);
             
              // This is a show stopper, so just fire it now.
              throw(rc);
            }
            catch(DmcValueException dve){
              // If a value for an attribute doesn't pass the basic tests, we'll
              // get one of these, just repackage it as a rule exception
              DmcRuleException ex = new DmcRuleException(dve.getMessage(), null);
              ex.source(source);

              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex);             
            }
            catch(ResultException rex){
              // If we can't find a class or attribute, we'll get one of these
              DmcRuleException ex = new DmcRuleException(rex.getMessage(), null);
              ex.source(source);

              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex)
             
//              System.err.println(ex.toString());
            }
           
            if (ruledata == null)
              continue;
           
            try{
              ruledata.resolveReferences(sm);
            }
            catch(DmcValueExceptionSet ex){
              System.err.println(ex.toString() + "\nFile: " + ruledata.getFile() + "  Line: " + ruledata.getLineNumber());
            }
             
            try{
              DynamicInitIF rule = (DynamicInitIF) ruleDEF.newRuleInstance();
              rule.setRuleData(ruledata);
             
              allRuleData.add(ruledata);
             
//              addThisRule((RuleIF) rule);
View Full Code Here

Examples of org.dmd.dms.RuleDefinition

     
      for(String key: sortedRules.keySet()){
        ArrayList<RuleIF> ruleset = sortedRules.get(key);
        String base = key.substring(0, key.length()-4);
        StringName rdn = new StringName(base);
        RuleDefinition rd = sm.ruleDefs.get(rdn);
        dumpRuleInstances(out, rd, ruleset);
      }
     
     
      out.write("  </table>\n\n");
View Full Code Here

Examples of org.jresearch.flexess.core.checker.rules.impl.RuleDefinition

  }

  protected void fireModelChanged(Object parent, Object source, String ruleKey) throws RuleExecutionException {
    IRule rule = ruleManager.getRule(ruleKey);
    if (rule != null) {
      RuleDefinition ev = new RuleDefinition(parent, source);
      rule.executeRule(ev);
    }
  }
View Full Code Here

Examples of org.rioproject.sla.RuleMap.RuleDefinition

        List<ServiceDefinition> services = new ArrayList<ServiceDefinition>();
        ServiceDefinition service = new ServiceDefinition("S1");
        //service.addWatches("load", "CPU");
        service.addWatches("load");
        services.add(service);
        RuleDefinition rule = new RuleDefinition("ScalingRuleHandler");
        ruleMap.addRuleMapping(rule, services.toArray(new ServiceDefinition[services.size()]));
        return ruleMap;
    }
View Full Code Here

Examples of org.rioproject.sla.RuleMap.RuleDefinition

       
        service = new ServiceDefinition("S3");
        service.addWatches("load");
        services.add(service);

        RuleDefinition rule = new RuleDefinition("ScalingRuleHandler");

        ruleMap.addRuleMapping(rule, services.toArray(new ServiceDefinition[services.size()]));
        return ruleMap;
    }
View Full Code Here

Examples of org.zkoss.zuss.metainfo.RuleDefinition

      if (token instanceof Keyword) {
        parseKeyword(ctx, (Keyword)token);
      } else if (token instanceof Id) {
        parseId(ctx, (Id)token);
      } else if (token instanceof Selector) {
        final RuleDefinition rdef = new RuleDefinition(ctx.block.owner, token.getLine());
        rdef.getSelectors().add(((Selector)token).getValue());
        parseSelector(ctx, rdef);
      } else if (!ctx.isRoot() && token instanceof Symbol
      && ((Symbol)token).getValue() == '}') {
        return; //done (closed)
      } else if (token instanceof Other) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.