Package org.apache.synapse.mediators.eip

Examples of org.apache.synapse.mediators.eip.Target


        if (!TARGET_Q.equals(elem.getQName())) {
            handleException("Element does not match with the target QName");
        }

        Target target = new Target();
        OMAttribute toAttr = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "to"));
        if (toAttr != null && toAttr.getAttributeValue() != null) {
            target.setToAddress(toAttr.getAttributeValue());
        }

        OMAttribute soapAction = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "soapAction"));
        if (soapAction != null && soapAction.getAttributeValue() != null) {
            target.setSoapAction(soapAction.getAttributeValue());
        }

        OMAttribute sequenceAttr = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "sequence"));
        if (sequenceAttr != null && sequenceAttr.getAttributeValue() != null) {
            target.setSequenceRef(sequenceAttr.getAttributeValue());
        }

        OMAttribute endpointAttr = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "endpoint"));
        if (endpointAttr != null && endpointAttr.getAttributeValue() != null) {
            target.setEndpointRef(endpointAttr.getAttributeValue());
        }

        OMElement sequence = elem.getFirstChildWithName(
                new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "sequence"));
        if (sequence != null) {
            SequenceMediatorFactory fac = new SequenceMediatorFactory();
            target.setSequence(fac.createAnonymousSequence(sequence, properties));
        }

        OMElement endpoint = elem.getFirstChildWithName(
                new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint"));
        if (endpoint != null) {
            target.setEndpoint(EndpointFactory.getEndpointFromElement(endpoint, true, properties));
        }

        return target;
    }
View Full Code Here


            asynchronous = false;
        }

        OMElement targetElement = elem.getFirstChildWithName(TARGET_Q);
        if (targetElement != null) {
            Target target = TargetFactory.createTarget(targetElement, properties);
            if (target != null) {
                target.setAsynchronous(asynchronous);
                mediator.setTarget(target);
            }
        } else {
            handleException("Target for an iterate mediator is required :: missing target");
        }
View Full Code Here

            }
        }

        OMElement targetElem = omElement.getFirstChildWithName(TARGET_Q);
        if (targetElem != null) {
            Target target = TargetFactory.createTarget(targetElem, properties);
            samplingThrottleMediator.setTarget(target);
        } else {
            handleException("Sampler requires a target for the sampling mediation");
        }
View Full Code Here

            } catch (EvaluatorException ee) {
                handleException("Couldn't build the condition of the conditional router", ee);
            }

            OMElement targetElem = routeElem.getFirstChildWithName(TARGET_Q);
            Target target = TargetFactory.createTarget(targetElem, properties);
            if (JavaUtils.isTrueExplicitly(routeElem.getAttributeValue(ASYNCHRONOUS_ATTR))) {
                target.setAsynchronous(true);
            } else {
                target.setAsynchronous(false);
            }
            route.setTarget(target);
            conditionalRouterMediator.addRoute(route);
        }
        return conditionalRouterMediator;
View Full Code Here

                // clone message context for this target
                MessageContext newContext = getClonedMessageContext(synCtx, i, targets.size());
                Object o = targets.get(i);

                if (o instanceof Target) {
                    Target target = (Target) o;
                    target.mediate(newContext);
                }
            }
        }

        // finalize tracing and debugging
View Full Code Here

        if (!TARGET_Q.equals(elem.getQName())) {
            handleException("Element does not match with the target QName");
        }

        Target target = new Target();
        OMAttribute toAttr = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "to"));
        if (toAttr != null && toAttr.getAttributeValue() != null) {
            target.setTo(toAttr.getAttributeValue());
        }

        OMAttribute soapAction = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "soapAction"));
        if (soapAction != null && soapAction.getAttributeValue() != null) {
            target.setSoapAction(soapAction.getAttributeValue());
        }

        OMAttribute sequenceAttr = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "sequence"));
        if (sequenceAttr != null && sequenceAttr.getAttributeValue() != null) {
            target.setSequenceRef(sequenceAttr.getAttributeValue());
        }

        OMAttribute endpointAttr = elem.getAttribute(
                new QName(XMLConfigConstants.NULL_NAMESPACE, "endpoint"));
        if (endpointAttr != null && endpointAttr.getAttributeValue() != null) {
            target.setEndpointRef(endpointAttr.getAttributeValue());
        }

        OMElement sequence = elem.getFirstChildWithName(
                new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "sequence"));
        if (sequence != null) {
            SequenceMediatorFactory fac = new SequenceMediatorFactory();
            target.setSequence(fac.createAnonymousSequence(sequence));
        }

        OMElement endpoint = elem.getFirstChildWithName(
                new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint"));
        if (endpoint != null) {
            target.setEndpoint(EndpointAbstractFactory.
                    getEndpointFactroy(endpoint).createEndpoint(endpoint, true));
        }

        return target;
    }
View Full Code Here

            asynchronous = false;
        }

        OMElement targetElement = elem.getFirstChildWithName(TARGET_Q);
        if (targetElement != null) {
            Target target = TargetFactory.createTarget(targetElement, properties);
            if (target != null) {
                target.setAsynchronous(asynchronous);
                mediator.setTarget(target);
            }
        } else {
            handleException("Target for an iterate mediator is required :: missing target");
        }
View Full Code Here

        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

            } catch (EvaluatorException ee) {
                handleException("Couldn't build the condition of the conditional router", ee);
            }

            OMElement targetElem = routeElem.getFirstChildWithName(TARGET_Q);
            Target target = TargetFactory.createTarget(targetElem, properties);
            if (JavaUtils.isTrueExplicitly(routeElem.getAttributeValue(ASYNCHRONOUS_ATTR))) {
                target.setAsynchronous(true);
            } else {
                target.setAsynchronous(false);
            }
            conditionalRoute.setTarget(target);
            conditionalRouterMediator.addRoute(conditionalRoute);
        }
        return conditionalRouterMediator;
View Full Code Here

            }
        }

        OMElement targetElem = omElement.getFirstChildWithName(TARGET_Q);
        if (targetElem != null) {
            Target target = TargetFactory.createTarget(targetElem, properties);
            samplingThrottleMediator.setTarget(target);
        } else {
            handleException("Sampler requires a target for the sampling mediation");
        }
View Full Code Here

TOP

Related Classes of org.apache.synapse.mediators.eip.Target

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.