Package org.apache.synapse.commons.evaluators.config

Examples of org.apache.synapse.commons.evaluators.config.EvaluatorSerializer


    private OMElement serializeRule(RewriteRule r) throws EvaluatorException {
        OMElement rule = fac.createOMElement("rewriterule", synNS);
        Evaluator condition = r.getCondition();
        if (condition != null) {
            OMElement conditionElt = fac.createOMElement("condition", synNS);
            EvaluatorSerializer serializer = EvaluatorSerializerFinder.getInstance().
                    getSerializer(condition.getName());
            serializer.serialize(conditionElt, condition);
            rule.addChild(conditionElt);
        }

        List<RewriteAction> actions = r.getActions();
        for (RewriteAction a : actions) {
View Full Code Here


    private OMElement serializeRule(RewriteRule r) throws EvaluatorException {
        OMElement rule = fac.createOMElement("rule", synNS);
        Evaluator condition = r.getCondition();
        if (condition != null) {
            OMElement conditionElt = fac.createOMElement("condition", synNS);
            EvaluatorSerializer serializer = EvaluatorSerializerFinder.getInstance().
                    getSerializer(condition.getName());
            serializer.serialize(conditionElt, condition);
            rule.addChild(conditionElt);
        }

        List<RewriteAction> actions = r.getActions();
        for (RewriteAction a : actions) {
View Full Code Here

            if (route.isBreakRouteExplicitlySet()) {
                routeElem.addAttribute("breakRoute", Boolean.toString(route.isBreakRoute()), nullNS);
            }
           
            if (route.getEvaluator() != null) {
                EvaluatorSerializer evaluatorSerializer =
                        EvaluatorSerializerFinder.getInstance().getSerializer(
                                route.getEvaluator().getName());
                if (evaluatorSerializer != null) {
                    OMElement conditionElement = fac.createOMElement("condition", synNS);
                    try {
                        evaluatorSerializer.serialize(conditionElement, route.getEvaluator());
                    } catch (EvaluatorException e) {
                        handleException("Cannot serialize the Evaluator", e);
                    }

                    routeElem.addChild(conditionElement);
View Full Code Here

            if (conditionalRoute.isBreakRouteExplicitlySet()) {
                routeElem.addAttribute("breakRoute", Boolean.toString(conditionalRoute.isBreakRoute()), nullNS);
            }
           
            if (conditionalRoute.getEvaluator() != null) {
                EvaluatorSerializer evaluatorSerializer =
                        EvaluatorSerializerFinder.getInstance().getSerializer(
                                conditionalRoute.getEvaluator().getName());
                if (evaluatorSerializer != null) {
                    OMElement conditionElement = fac.createOMElement("condition", synNS);
                    try {
                        evaluatorSerializer.serialize(conditionElement, conditionalRoute.getEvaluator());
                    } catch (EvaluatorException e) {
                        handleException("Cannot serialize the Evaluator", e);
                    }

                    routeElem.addChild(conditionElement);
View Full Code Here

    private OMElement serializeRule(RewriteRule r) throws EvaluatorException {
        OMElement rule = fac.createOMElement("rewriterule", synNS);
        Evaluator condition = r.getCondition();
        if (condition != null) {
            OMElement conditionElt = fac.createOMElement("condition", synNS);
            EvaluatorSerializer serializer = EvaluatorSerializerFinder.getInstance().
                    getSerializer(condition.getName());
            serializer.serialize(conditionElt, condition);
            rule.addChild(conditionElt);
        }

        List<RewriteAction> actions = r.getActions();
        for (RewriteAction a : actions) {
View Full Code Here

  public String getTagLocalName() {
    return "rewriterule";
  }

  public String getCondition() {
      EvaluatorSerializer evaluatorSerializer =
              EvaluatorSerializerFinder.getInstance().getSerializer(evaluator.getName());
      if (evaluatorSerializer != null) {
          OMElement conditionElem = fac.createOMElement("condition", synNS);
          try {
              evaluatorSerializer.serialize(conditionElem, evaluator);
          } catch (EvaluatorException ee) {
          }
          condition = conditionElem.toString();
      }
      return condition;
View Full Code Here

    OMElement urlRule = fac.createOMElement("rewriterule", synNS);
    saveTracingState(urlRule, this);

    // add condition block, its optional
      if (evaluator != null) {
              EvaluatorSerializer evaluatorSerializer =
                      EvaluatorSerializerFinder.getInstance().getSerializer(evaluator.getName());
              if (evaluatorSerializer != null) {
                OMElement conditionElement = fac.createOMElement("condition", synNS);
                  try {
                      evaluatorSerializer.serialize(conditionElement, evaluator);
                  } catch (EvaluatorException ee) {
                  }
                  urlRule.addChild(conditionElement);
              }
          }
View Full Code Here

    public OMElement serialize(OMElement parent) {

        OMElement routeElem = fac.createOMElement(ROUTE, synNS);

        if (evaluator != null) {
            EvaluatorSerializer evaluatorSerializer =
                    EvaluatorSerializerFinder.getInstance().getSerializer(evaluator.getName());
            if (evaluatorSerializer != null) {
                OMElement conditionElem = fac.createOMElement(CONDITION, synNS);
                try {
                    evaluatorSerializer.serialize(conditionElem, evaluator);
                } catch (EvaluatorException ee) {
                }
                routeElem.addChild(conditionElem);
            }
        }
View Full Code Here

    }


    public String getConditionString() {
        String conditionStr = "";
        EvaluatorSerializer evaluatorSerializer =
                EvaluatorSerializerFinder.getInstance().getSerializer(evaluator.getName());
        if (evaluatorSerializer != null) {
            OMElement conditionElem = fac.createOMElement(CONDITION, synNS);
            try {
                evaluatorSerializer.serialize(conditionElem, evaluator);
            } catch (EvaluatorException ee) {
            }
            conditionStr = conditionElem.toString();
        }
        return conditionStr;
View Full Code Here

TOP

Related Classes of org.apache.synapse.commons.evaluators.config.EvaluatorSerializer

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.