Package org.apache.synapse.config.xml

Examples of org.apache.synapse.config.xml.ValueFactory


              List<Member> members = getMembers(recipientListElement);
              recipientListEndpoint.setMembers(members);

            } else if (recipientListElement.getFirstChildWithName(DYNAMIC_SET) != null) {
                OMElement dynamicSetElement = recipientListElement.getFirstChildWithName(DYNAMIC_SET);
                Value dynamicEndpointSet = new ValueFactory().createValue("value", dynamicSetElement);
                String maxCacheStr = dynamicSetElement.getAttributeValue(new QName("max-cache"));
                int maxCache = RecipientListEndpoint.DEFAULT_MAX_POOL ;
                if (maxCacheStr != null) {
                    maxCache = Integer.parseInt(maxCacheStr);
                }
View Full Code Here


                "key"));
        OMAttribute attrTarget = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                "target"));
        if (xqueryKey != null) {
            // KeyFactory for creating dynamic or static Key
            ValueFactory keyFac = new ValueFactory();
            // create dynamic or static key based on OMElement
            Value generatedKey = keyFac.createValue(XMLConfigConstants.KEY, elem);

            if (generatedKey != null) {
                // set generated key as the Key
                xQueryMediator.setQueryKey(generatedKey);
            } else {
View Full Code Here

        Map<Value, Object> includeKeysMap = getIncludeKeysMap(elem);

        if (keyAtt != null) {

            // ValueFactory for creating dynamic or static Key
            ValueFactory keyFac = new ValueFactory();
            // create dynamic or static key based on OMElement
            Value generatedKey = keyFac.createValue(XMLConfigConstants.KEY, elem);

            String functionName = (functionAtt == null ? null : functionAtt.getAttributeValue());
            mediator = new ScriptMediator(langAtt.getAttributeValue(),
                    includeKeysMap, generatedKey, functionName);
        } else {
View Full Code Here

        while (itr.hasNext()) {
            OMElement includeElem = (OMElement) itr.next();
            OMAttribute key = includeElem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                    "key"));
            // ValueFactory for creating dynamic or static Value
            ValueFactory keyFac = new ValueFactory();
            // create dynamic or static key based on OMElement
            Value generatedKey = keyFac.createValue(XMLConfigConstants.KEY, elem);

            if (key == null) {
                throw new SynapseException("Cannot use 'include' element without 'key'" +
                        " attribute for a script mediator");
            }
View Full Code Here

    }

    public void build(OMElement element) {
        OMAttribute topicAttr = element.getAttribute(new QName("topic"));
        if (topicAttr != null) {
            ValueFactory vf = new ValueFactory();
            Value value = vf.createValue("topic", element);

            setTopic(value);
        }

        OMAttribute expression = element.getAttribute(new QName("expression"));
View Full Code Here

            if (endpoint != null) {
                setEndpoint(endpoint);
            }
        }
        if (elem.getAttributeValue(new QName(null, "receive")) != null) {
            ValueFactory keyFactory = new ValueFactory();
            receivingSeqValue = keyFactory.createValue("receive", elem);
        }
    }
View Full Code Here

    protected Mediator createSpecificMediator(OMElement element, Properties properties) {
        EventMediator event = new EventMediator();

        OMAttribute topicAttr = element.getAttribute(new QName("topic"));
        if (topicAttr != null) {
            ValueFactory vf = new ValueFactory();
            Value value = vf.createValue("topic", element);

            event.setTopic(value);
        }

        OMAttribute expression = element.getAttribute(new QName("expression"));
View Full Code Here

            } else {
                n = elem.getAttribute(ATT_KEY);
                if (n != null) {
                    //Use KeyFactory to create Key
                    ValueFactory keyFactory = new ValueFactory();
                    key = keyFactory.createValue(XMLConfigConstants.KEY, elem);

                    if (e != null) {
                        String msg = "A sequence mediator with a reference to another " +
                                "sequence can not have 'ErrorHandler'";
                        throw new MediatorException(msg);
View Full Code Here

            String functionName = (funcAtt == null ? null : funcAtt.getAttributeValue());
            this.language = langAtt.getAttributeValue();
            this.function = functionName;

            //Use KeyFactory to create Key
            ValueFactory keyFactory = new ValueFactory();
            key = keyFactory.createValue(XMLConfigConstants.KEY, elem);
           
        } else {
            this.language = langAtt.getAttributeValue();
            this.scriptSourceCode = elem.getText();
        }
View Full Code Here

                "key"));
        OMAttribute attrTarget = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                "target"));
        if (xqueryKey != null) {
            //Use KeyFactory to create Key
            ValueFactory keyFactory = new ValueFactory();
            queryKey = keyFactory.createValue(XMLConfigConstants.KEY, elem);
        } else {
            throw new MediatorException("The 'key' attribute is required for the XQuery mediator");
        }
        if (attrTarget != null) {
            String targetValue = attrTarget.getAttributeValue();
View Full Code Here

TOP

Related Classes of org.apache.synapse.config.xml.ValueFactory

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.