Examples of OMAttribute


Examples of org.apache.axiom.om.OMAttribute

    }

    protected DetachMediator createSpecificMediator(OMElement elem, Properties properties) {
        DetachMediator mediator = new DetachMediator();

        OMAttribute attSource = elem.getAttribute(ATT_SOURCE);
        OMAttribute attProperty = elem.getAttribute(ATT_PROPERTY);
       
        if (attSource != null) {
            try {
                mediator.setSource(new SynapseXPath(attSource));
            } catch (JaxenException e) {
                handleException("Invalid XPath specified for the source attribute : " +
                    attSource.getAttributeValue());
            }
        }
       
        if (attProperty != null) {
            mediator.setProperty(attProperty.getAttributeValue());
        } else {
            handleException("The 'property' attribute is required for the detach mediator");
        }
       
        return mediator;
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

     * @return the Spring mediator instance created
     */
    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {

        SpringMediator sm = new SpringMediator();
        OMAttribute bean = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "bean"));
        OMAttribute key  = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "key"));

        if (bean == null) {
            handleException("The 'bean' attribute is required for a Spring mediator definition");
        } else if (key == null) {
            handleException("A 'key' attribute is required for a Spring mediator definition");
        } else {

             // after successfully creating the mediator
             // set its common attributes such as tracing etc
            processAuditStatus(sm,elem);
            sm.setBeanName(bean.getAttributeValue());
            sm.setConfigKey(key.getAttributeValue());
            return sm;
        }
        return null;
    }
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute


    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {

        XQueryMediator xQueryMediator = new XQueryMediator();
        OMAttribute xqueryKey = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                "key"));
        OMAttribute attrTarget = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE,
                "target"));
        if (xqueryKey != null) {
            String queryKey = xqueryKey.getAttributeValue();
            if (queryKey != null) {
                xQueryMediator.setQueryKey(queryKey.trim());
            } else {
                handleException("The 'key' attribute is required for the XQuery mediator");
            }
        } else {
            handleException("The 'key' attribute is required for the XQuery mediator");
        }
        if (attrTarget != null) {
            String targetValue = attrTarget.getAttributeValue();
            if (targetValue != null && !"".equals(targetValue)) {
                try {                            
                    xQueryMediator.setTarget(SynapseXPathFactory.getSynapseXPath(elem, ATT_TARGET));
                } catch (JaxenException e) {
                    handleException("Invalid XPath specified for the target attribute : " +
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {

        CalloutMediator callout = new CalloutMediator();

        OMAttribute attServiceURL = elem.getAttribute(ATT_URL);
        OMAttribute attAction     = elem.getAttribute(ATT_ACTION);
        OMElement   configElt     = elem.getFirstChildWithName(Q_CONFIG);
        OMElement   sourceElt     = elem.getFirstChildWithName(Q_SOURCE);
        OMElement   targetElt     = elem.getFirstChildWithName(Q_TARGET);

        if (attServiceURL != null) {
            callout.setServiceURL(attServiceURL.getAttributeValue());
        } else {
            handleException("The 'serviceURL' attribute is required for the Callout mediator");
        }

        if (attAction != null) {
            callout.setAction(attAction.getAttributeValue());
        }

        if (configElt != null) {

            OMAttribute axis2xmlAttr = configElt.getAttribute(ATT_AXIS2XML);
            OMAttribute repoAttr = configElt.getAttribute(ATT_REPOSITORY);

            if (axis2xmlAttr != null && axis2xmlAttr.getAttributeValue() != null) {
                callout.setAxis2xml(axis2xmlAttr.getAttributeValue());
            }

            if (repoAttr != null && repoAttr.getAttributeValue() != null) {
                callout.setClientRepository(repoAttr.getAttributeValue());
            }
        }

        if (sourceElt != null) {
            if (sourceElt.getAttribute(ATT_XPATH) != null) {
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

    public static final QName NAME_Q
            = new QName(XMLConfigConstants.NULL_NAMESPACE, "name");

    public static Registry createRegistry(OMElement elem, Properties properties) {

        OMAttribute prov = elem.getAttribute(PROVIDER_Q);
        if (prov != null) {
            try {
                Class provider = Class.forName(prov.getAttributeValue());
                Registry registry = (Registry) provider.newInstance();
                registry.init(getProperties(elem, properties));
                return registry;

            } catch (ClassNotFoundException e) {
                handleException("Cannot locate registry provider class : " +
                    prov.getAttributeValue(), e);
            } catch (IllegalAccessException e) {
                handleException("Error instantiating registry provider : " +
                    prov.getAttributeValue(), e);
            } catch (InstantiationException e) {
                handleException("Error instantiating registry provider : " +
                    prov.getAttributeValue(), e);
            }
        } else {
            handleException("The registry 'provider' " +
                    "attribute is required for a registry definition");
        }
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

        Properties props = new Properties(topLevelProps);
        while (params.hasNext()) {
            Object o = params.next();
            if (o instanceof OMElement) {
                OMElement prop = (OMElement) o;
                OMAttribute pname = prop.getAttribute(NAME_Q);
                String propertyValue = prop.getText();
                if (pname != null) {
                    if (propertyValue != null) {
                        props.setProperty(pname.getAttributeValue(), propertyValue.trim());
                    }
                } else {
                    handleException("Invalid registry property - property should have a name ");
                }
            } else {
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

        if (loadbalanceElement != null) {

            DynamicLoadbalanceEndpoint loadbalanceEndpoint = new DynamicLoadbalanceEndpoint();

            // set endpoint name
            OMAttribute name =
                    epConfig.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));

            if (name != null) {
                loadbalanceEndpoint.setName(name.getAttributeValue());
            }

            // get the session for this endpoint
            OMElement sessionElement = epConfig.
                    getFirstChildWithName(new QName(SynapseConstants.SYNAPSE_NAMESPACE, "session"));
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

            handleException("Session affinity endpoints should " +
                    "have a session element in the configuration.");
        }

        // set endpoint name
        OMAttribute name = epConfig.getAttribute(new QName(
                org.apache.synapse.config.xml.XMLConfigConstants.NULL_NAMESPACE, "name"));

        if (name != null) {
            loadbalanceEndpoint.setName(name.getAttributeValue());
        }

        OMElement loadbalanceElement;
        loadbalanceElement = epConfig.getFirstChildWithName
                (new QName(SynapseConstants.SYNAPSE_NAMESPACE, "loadbalance"));
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

        return SEQUENCE_Q;
    }

    public SequenceMediator createAnonymousSequence(OMElement elem, Properties properties) {
        SequenceMediator seqMediator = new SequenceMediator();
        OMAttribute e = elem.getAttribute(ATT_ONERROR);
        if (e != null) {
            seqMediator.setErrorHandler(e.getAttributeValue());
        }
        processAuditStatus(seqMediator, elem);
        OMElement descElem = elem.getFirstChildWithName(DESCRIPTION_Q);
        if (descElem != null) {
            seqMediator.setDescription(descElem.getText());
View Full Code Here

Examples of org.apache.axiom.om.OMAttribute

   
    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {

        SequenceMediator seqMediator = new SequenceMediator();

        OMAttribute n = elem.getAttribute(ATT_NAME);
        OMAttribute e = elem.getAttribute(ATT_ONERROR);
        if (n != null) {
            seqMediator.setName(n.getAttributeValue());
            if (e != null) {
                seqMediator.setErrorHandler(e.getAttributeValue());
            }
            processAuditStatus(seqMediator, elem);
            addChildren(elem, seqMediator, properties);

        } else {
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.