Package org.apache.synapse.mediators.eip.splitter

Examples of org.apache.synapse.mediators.eip.splitter.CloneMediator


     * @param properties additional information for creating the mediator
     * @return Mediator of the type CloneMediator built from the config element
     */
    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {

        CloneMediator mediator = new CloneMediator();
        processAuditStatus(mediator, elem);
       
        OMAttribute continueParent = elem.getAttribute(ATT_CONTINUE_PARENT);
        if (continueParent != null) {
            mediator.setContinueParent(JavaUtils.isTrueExplicitly(
                    continueParent.getAttributeValue()));
        }

        Iterator targetElements = elem.getChildrenWithName(TARGET_Q);
        while (targetElements.hasNext()) {
            mediator.addTarget(TargetFactory.createTarget(
                    (OMElement) targetElements.next(), properties));
        }

        return mediator;
    }
View Full Code Here


    protected OMElement serializeSpecificMediator(Mediator m) {

        OMElement cloneElem = fac.createOMElement("clone", synNS);
        saveTracingState(cloneElem, m);

        CloneMediator clone = (CloneMediator) m;
        if (clone.isContinueParent()) {
            cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS);
        }

        for (Iterator itr = clone.getTargets().iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (o instanceof Target) {
                cloneElem.addChild(TargetSerializer.serializeTarget((Target) o));
            }
        }
View Full Code Here

     *  to build the CloneMediator
     * @return Mediator of the type CloneMediator built from the config element
     */
    public Mediator createMediator(OMElement elem) {

        CloneMediator mediator = new CloneMediator();
        processTraceState(mediator, elem);
       
        OMAttribute continueParent = elem.getAttribute(ATT_CONTPAR);
        if (continueParent != null) {
            mediator.setContinueParent(
                    Boolean.valueOf(continueParent.getAttributeValue()).booleanValue());
        }

        Iterator targetElements = elem.getChildrenWithName(TARGET_Q);
        while (targetElements.hasNext()) {
            mediator.addTarget(TargetFactory.createTarget((OMElement) targetElements.next()));
        }

        return mediator;
    }
View Full Code Here

    public OMElement serializeMediator(OMElement parent, Mediator m) {

        OMElement cloneElem = fac.createOMElement("clone", synNS);
        saveTracingState(cloneElem, m);

        CloneMediator clone = (CloneMediator) m;
        if (clone.isContinueParent()) {
            cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS);
        }

        for (Iterator itr = clone.getTargets().iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (o instanceof Target) {
                cloneElem.addChild(TargetSerializer.serializeTarget((Target) o));
            }
        }
View Full Code Here

     */
    public Mediator createSpecificMediator(OMElement elem, Properties properties) {
     
      boolean asynchronousExe = true;
       
      CloneMediator mediator = new CloneMediator();
        processAuditStatus(mediator, elem);

        OMAttribute id = elem.getAttribute(ID_Q);
        if (id != null) {
            mediator.setId(id.getAttributeValue());
        }


        OMAttribute continueParent = elem.getAttribute(ATT_CONTINUE_PARENT);
        if (continueParent != null) {
            mediator.setContinueParent(JavaUtils.isTrueExplicitly(
                    continueParent.getAttributeValue()));
        }

        OMAttribute synchronousExeAttr= elem.getAttribute(SEQUENTIAL_Q);
        if (synchronousExeAttr != null && synchronousExeAttr.getAttributeValue().equals("true")) {
          asynchronousExe = false;
        }

        mediator.setSequential(!asynchronousExe);
       
        Iterator targetElements = elem.getChildrenWithName(TARGET_Q);
        while (targetElements.hasNext()) {
          Target target = TargetFactory.createTarget((OMElement)targetElements.next(), properties);
          target.setAsynchronous(asynchronousExe);
            mediator.addTarget(target);
        }
   
        return mediator;
    }
View Full Code Here

    public OMElement serializeSpecificMediator(Mediator m) {

        OMElement cloneElem = fac.createOMElement("clone", synNS);
        saveTracingState(cloneElem, m);

        CloneMediator clone = (CloneMediator) m;
        if (clone.isContinueParent()) {
            cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS);
        }

        if (clone.getId() != null) {
            cloneElem.addAttribute("id", clone.getId(), nullNS);
        }

        if (clone.isSequential()) {
            cloneElem.addAttribute("sequential", "true", nullNS);
        }

        for (Object o : clone.getTargets()) {
            if (o instanceof Target) {
                cloneElem.addChild(TargetSerializer.serializeTarget((Target) o));
            }
        }
        return cloneElem;
View Full Code Here

        if (!(m instanceof CloneMediator)) {
            return null;
        }

        List<ConfigurationObject> providers = new ArrayList<ConfigurationObject>();
        CloneMediator cloneMediator  = (CloneMediator) m;
        List<Target> targets = cloneMediator.getTargets();
        for (Target t : targets) {
            resolveTarget(t, providers);
        }
        return providers;
    }
View Full Code Here

     *  to build the CloneMediator
     * @return Mediator of the type CloneMediator built from the config element
     */
    public Mediator createMediator(OMElement elem) {

        CloneMediator mediator = new CloneMediator();
        processTraceState(mediator, elem);
       
        OMAttribute continueParent = elem.getAttribute(ATT_CONTPAR);
        if (continueParent != null) {
            mediator.setContinueParent(
                    Boolean.valueOf(continueParent.getAttributeValue()).booleanValue());
        }

        Iterator targetElements = elem.getChildrenWithName(TARGET_Q);
        while (targetElements.hasNext()) {
            mediator.addTarget(TargetFactory.createTarget((OMElement) targetElements.next()));
        }

        return mediator;
    }
View Full Code Here

    public OMElement serializeMediator(OMElement parent, Mediator m) {

        OMElement cloneElem = fac.createOMElement("clone", synNS);
        saveTracingState(cloneElem, m);

        CloneMediator clone = (CloneMediator) m;
        if (clone.isContinueParent()) {
            cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS);
        }

        for (Iterator itr = clone.getTargets().iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (o instanceof Target) {
                cloneElem.addChild(TargetSerializer.serializeTarget((Target) o));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.synapse.mediators.eip.splitter.CloneMediator

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.