Examples of QName

The value of a QName contains a namespaceURI and a localPart. The localPart provides the local part of the qualified name. The namespaceURI is a URI reference identifying the namespace.

The prefix is included in the QName class to retain lexical information where present in an XML input source. The prefix is NOT used to compute the hash code or in the equals operation. In other words, equality is defined only using the namespaceURI and the localPart. @version 1.1

  • javax.xml.rpc.namespace.QName
    QName class represents a qualified name based on "Namespaces in XML" specification. A QName is represented as: QName ::= (Prefix ':') ? LocalPart Upgraded the implementation so that the namespaceURI and localPart are always non-null. This simplifies the implementation, increases performance, and cleans up NullPointerException problems. Upgraded the implemenation to make QName a final class, changed the namespaceURI and localPart to final (and interned) Strings, changed equals() to use == comparison on interned Strings. @version 0.1
  • macromedia.asc.semantics.QName
    @author Erik Tierney
  • mf.javax.xml.namespace.QName
    3.org/TR/xmlschema-2/#QName">XML Schema Part2: Datatypes specification, Namespaces in XML, Namespaces in XML Errata.

    The value of a QName contains a Namespace URI, local part and prefix.

    The prefix is included in QName to retain lexical information when present in an {@link javax.xml.transform.Source XML input source}. The prefix is NOT used in {@link #equals(Object) QName.equals(Object)} or to compute the {@link #hashCode() QName.hashCode()}. Equality and the hash code are defined using only the Namespace URI and local part.

    If not specified, the Namespace URI is set to {@link javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI}. If not specified, the prefix is set to {@link javax.xml.XMLConstants#DEFAULT_NS_PREFIX XMLConstants.DEFAULT_NS_PREFIX}.

    QName is immutable.

    @author Jeff Suttor @version $Revision: 1.9 $, $Date: 2010-11-01 04:36:08 $ @see XML Schema Part2: Datatypes specification @see Namespaces in XML @see Namespaces in XML Errata @since 1.5
  • mf.org.apache.xerces.xni.QName
    A structure that holds the components of an XML Namespaces qualified name.

    To be used correctly, the strings must be identical references for equal strings. Within the parser, these values are considered symbols and should always be retrieved from the SymbolTable. @see org.apache.xerces.util.SymbolTable @author Andy Clark, IBM @version $Id: QName.java 447247 2006-09-18 05:23:52Z mrglavas $

  • net.sf.saxon.s9api.QName
    The QName class represents an instance of xs:QName, as defined in the XPath 2.0 data model. Internally, it has three components, a namespace URI, a local name, and a prefix. The prefix is intended to be used only when converting the value back to a string.

    This class also defines a number of QName-valued constants relating to built-in types in XML Schema

    A QName is immutable.

    Note that a QName is not itself an {@link XdmItem} in this model; however it can be wrapped in anXdmItem.

  • org.alfresco.service.namespace.QName
  • org.apache.axis.utils.QName
    @author Doug Davis (dug@us.ibm.com) @author James Snell (jasnell@us.ibm.com)
  • org.apache.commons.jxpath.ri.QName
    A qualified name: a combination of an optional namespace prefix and an local name. @author Dmitri Plotnikov @version $Revision: 1.6 $ $Date: 2003/03/11 00:59:19 $
  • org.apache.fop.util.QName
    Represents a qualified name of an XML element or an XML attribute.

    Note: This class allows to carry a namespace prefix but it is not used in the equals() and hashCode() methods.

  • org.apache.jackrabbit.name.QName
    Qualified name. A qualified name is a combination of a namespace URI and a local part. Instances of this class are used to internally represent the names of JCR content items and other objects within a content repository.

    A qualified name is immutable once created, although the prefixed JCR name representation of the qualified name can change depending on the namespace mappings in effect.

    This class also contains a number of common namespace and qualified name constants for the namespaces and names specified by the JCR specification.

    String representations

    The prefixed JCR name format of a qualified name is specified by section 4.6 of the the JCR 1.0 specification (JSR 170) as follows:

     name                ::= simplename | prefixedname simplename          ::= onecharsimplename | twocharsimplename | threeormorecharname prefixedname        ::= prefix ':' localname localname           ::= onecharlocalname | twocharlocalname | threeormorecharname onecharsimplename   ::= (* Any Unicode character except: '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *) twocharsimplename   ::= '.' onecharsimplename | onecharsimplename '.' | onecharsimplename onecharsimplename onecharlocalname    ::= nonspace twocharlocalname    ::= nonspace nonspace threeormorecharname ::= nonspace string nonspace prefix              ::= (* Any valid XML Name *) string              ::= char | string char char                ::= nonspace | ' ' nonspace            ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *) 

    In addition to the prefixed JCR name format, a qualified name can also be represented using the format "{namespaceURI}localPart".

  • org.apache.soap.util.xml.QName
    A QName represents a fully-qualified name. @author Matthew J. Duftler (duftler@us.ibm.com) @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
  • org.apache.util.QName
    A QName represents a fully-qualified name. @author Dirk Verbeeck
  • org.apache.webdav.lib.util.QName
    A QName represents a fully-qualified name.
  • org.apache.xalan.xpath.xml.QName
    Class to represent a qualified name: "The name of an internal XSLT object, specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]), an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]), a locale (see [14.3 Number Formatting]), a variable or a parameter (see [12 Variables and Parameters]) is specified as a QName. If it has a prefix, then the prefix is expanded into a URI reference using the namespace declarations in effect on the attribute in which the name occurs. The expanded name consisting of the local part of the name and the possibly null URI reference is used as the name of the object. The default namespace is not used for unprefixed names."
  • org.apache.xerces.utils.QName
    QName structure useful for gathering the parts of a qualified name. @author Andy Clark @version $Id: QName.java,v 1.2 2000/05/17 18:32:51 jeffreyr Exp $
  • org.apache.xerces.xni.QName
    A structure that holds the components of an XML Namespaces qualified name.

    To be used correctly, the strings must be identical references for equal strings. Within the parser, these values are considered symbols and should always be retrieved from the SymbolTable. @see org.apache.xerces.util.SymbolTable @author Stubs generated by DesignDoc on Wed Jun 07 11:58:44 PDT 2000 @author Andy Clark, IBM @version $Id: QName.java,v 1.1.2.3 2000/10/10 08:04:57 andyc Exp $

  • org.apache.xml.utils.QName
    Class to represent a qualified name: "The name of an internal XSLT object, specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]), an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]), a locale (see [14.3 Number Formatting]), a variable or a parameter (see [12 Variables and Parameters]) is specified as a QName. If it has a prefix, then the prefix is expanded into a URI reference using the namespace declarations in effect on the attribute in which the name occurs. The expanded name consisting of the local part of the name and the possibly null URI reference is used as the name of the object. The default namespace is not used for unprefixed names."
  • org.apache.xmlgraphics.util.QName
    Represents a qualified name of an XML element or an XML attribute.

    Note: This class allows to carry a namespace prefix but it is not used in the equals() and hashCode() methods.

  • org.camunda.bpm.model.xml.impl.util.QName
    @author Daniel Meyer
  • org.dom4j.QName

    QName represents a qualified name value of an XML element or attribute. It consists of a local name and a {@link Namespace}instance. This object is immutable.

    @author James Strachan
  • org.eclipse.emf.ecore.xml.type.internal.QName
    An internal extension of Java's QName that allows the prefix to be updated. If not specified, the prefix is set to empty string (""). If not specified, the namespace uri is set to empty string ("");

    NOTE: this class is for internal use only.

  • org.exist.dom.QName
    Represents a QName, consisting of a local name, a namespace URI and a prefix. @author Wolfgang
  • org.exoplatform.commons.utils.QName
    Created by The eXo Platform SAS . Qualified name @author Gennady Azarenkov @version $Id: $
  • org.jboss.mbui.model.structure.QName
    @author Harald Pehl @date 11/14/2012
  • org.jibx.runtime.QName

    Representation of a qualified name. This includes the JiBX serializer/deserializer methods for the representation. It assumes that the actual namespace declarations are being handled separately for marshalling

    Note that this implementation treats only the namespace and local name as significant for purposes of comparing values. The prefix is held only as a convenience, and the actual prefix used when writing a value may differ from the prefix defined by the instance.

    @author Dennis M. Sosnoski
  • org.lilyproject.repository.api.QName
    A qualified name. A qualified name consists of a namespace and a name.

    Qualifed names are used within the repository schema, see {@link FieldType}.

    They allow to re-use existing vocabularies (e.g. dublin core) without name clashes.

  • org.useware.kernel.model.structure.QName
    @author Harald Pehl @date 11/14/2012
  • org.wso2.javascript.xmlimpl.QName
  • tv.porst.swfretools.parser.structures.QName

  • Examples of javax.xml.namespace.QName

                log.debug("Template update from file : " + fileName + " has started");
            }

            try {
                OMElement element = artifactConfig.getFirstChildWithName(
                        new QName(SynapseConstants.SYNAPSE_NAMESPACE, "endpoint"));
                if (element != null) {
                    org.apache.synapse.config.xml.endpoints.TemplateFactory templateFactory =
                            new org.apache.synapse.config.xml.endpoints.TemplateFactory();

                    Template tm = templateFactory.createEndpointTemplate(artifactConfig, properties);

                    tm.setFileName(new File(fileName).getName());
                    if (log.isDebugEnabled()) {
                        log.debug("Endpoint Template named '" + tm.getName()
                                + "' has been built from the file " + fileName);
                    }

                    Template existingSt = getSynapseConfiguration().
                            getEndpointTemplate(existingArtifactName);

                    if (existingArtifactName.equals(tm.getName())) {
                        getSynapseConfiguration().updateEndpointTemplate(tm.getName(), existingSt);
                    } else {
                        getSynapseConfiguration().addEndpointTemplate(tm.getName(), tm);
                        getSynapseConfiguration().removeEndpointTemplate(existingSt.getName());
                        log.info("Template: " + existingArtifactName + " has been undeployed");
                    }

                    log.info("Template: " + tm.getName() + " has been updated from the file: " + fileName);
                    return tm.getName();
                } else {
                    element = artifactConfig.getFirstChildWithName(
                            new QName(SynapseConstants.SYNAPSE_NAMESPACE, "sequence"));
                    if (element != null) {
                        Mediator mediator = MediatorFactoryFinder.getInstance().
                                getMediator(artifactConfig, properties);
                        if (mediator instanceof TemplateMediator) {
                            TemplateMediator tm = (TemplateMediator) mediator;
    View Full Code Here

    Examples of javax.xml.namespace.QName

                    = (DeploymentClassLoader)deploymentFileData.getClassLoader();
                Thread.currentThread().setContextClassLoader(urlCl);

                // StartupFactory registration
                for (StartupFactory factory : getProviders(StartupFactory.class, urlCl)) {
                    QName tagQName = factory.getTagQName();
                    Class<? extends StartupFactory> clazz = factory.getClass();
                    StartupFinder finder = StartupFinder.getInstance();
                    finder.getFactoryMap().put(tagQName, clazz);
                    finder.getSerializerMap().put(tagQName, factory.getSerializerClass());
                    log.info("Registered startup factory and serializer for " + tagQName);
                }

                // MediatorFactory registration
                for (MediatorFactory factory : getProviders(MediatorFactory.class, urlCl)) {
                    QName tagQName = factory.getTagQName();
                    Class<? extends MediatorFactory> clazz = factory.getClass();
                    MediatorFactoryFinder.getInstance().getFactoryMap().put(tagQName, clazz);
                    log.info("Registered mediator factory " + clazz.getName() + " for " + tagQName);
                }
    View Full Code Here

    Examples of javax.xml.namespace.QName

            OMElement entryElement = fac.createOMElement("localEntry", synNS);
           
            if (entry.getDescription() != null) {

                OMElement descriptionElem = fac.createOMElement(
                        new QName(SynapseConstants.SYNAPSE_NAMESPACE, "description"));
                descriptionElem.setText(entry.getDescription());
                entryElement.addChild(descriptionElem);
            }

            entryElement.addAttribute(fac.createOMAttribute(
    View Full Code Here

    Examples of javax.xml.namespace.QName

                handleException("Error parsing priority configuration xml file " + fileName, e);
            }

            assert definitions != null;
            OMElement executorElem = definitions.getFirstChildWithName(
                    new QName(ExecutorConstants.PRIORITY_EXECUTOR));

            if (executorElem == null) {
                handleException(ExecutorConstants.PRIORITY_EXECUTOR +
                        " configuration is mandatory for priority based routing");
            }

            executor = PriorityExecutorFactory.createExecutor(
                    null, executorElem, false, new Properties());
            OMElement conditionsElem = definitions.getFirstChildWithName(
                    new QName(EvaluatorConstants.CONDITIONS));
            if (conditionsElem == null) {
                handleException("Conditions configuration is mandatory for priority based routing");
            }

            executor.init();

            assert conditionsElem != null;
            OMAttribute defPriorityAttr = conditionsElem.getAttribute(
                    new QName(EvaluatorConstants.DEFAULT_PRIORITY));
            if (defPriorityAttr != null) {
                parser = new Parser(Integer.parseInt(defPriorityAttr.getAttributeValue()));
            } else {
                parser = new Parser();
            }
    View Full Code Here

    Examples of javax.xml.namespace.QName

                Iterator templates = FileUtils.iterateFiles(templatesDir, extensions, false);
                while (templates.hasNext()) {
                    File file = (File) templates.next();
                    OMElement document = getOMElement(file);
                    OMElement element = document.getFirstChildWithName(
                                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "sequence"));
                    if (element != null) {
                        TemplateMediator mediator =
                                (TemplateMediator) SynapseXMLConfigurationFactory.defineMediatorTemplate(
                                        synapseConfig, document, properties);
                        if (mediator != null) {
                            mediator.setFileName(file.getName());
                            synapseConfig.getArtifactDeploymentStore().addArtifact(
                                    file.getAbsolutePath(), mediator.getName());
                        }
                        return;

                    } else {
                        element = document.getFirstChildWithName(
                                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "endpoint"));
                        if (element != null) {
                            Template endpointTemplate =
                                    SynapseXMLConfigurationFactory.defineEndpointTemplate(
                                            synapseConfig, document, properties);
                            if (endpointTemplate != null) {
    View Full Code Here

    Examples of javax.xml.namespace.QName

                            .getAxisOperation().getMessageExchangePattern());

            // get a reference to the DYNAMIC operation of the Anonymous Axis2 service
            AxisOperation axisAnonymousOperation = anoymousService.getOperation(
                outOnlyMessage ?
                    new QName(AnonymousServiceFactory.OUT_ONLY_OPERATION) :
                    new QName(AnonymousServiceFactory.OUT_IN_OPERATION));

            Options clientOptions = MessageHelper.cloneOptions(originalInMsgCtx.getOptions());
            clientOptions.setUseSeparateListener(separateListener);
            // if RM is requested,
            if (wsRMEnabled) {
    View Full Code Here

    Examples of javax.xml.namespace.QName

            super(omElement);

            String partnerLink = null;
            String operation = null;
            // Get Partner Link Name
            if (omElement.getAttribute(new QName("partnerLink")) != null)
                partnerLink = new String(omElement.getAttribute(new QName("partnerLink")).getAttributeValue());      //attention-  consider about namespace
            if (omElement.getAttribute(new QName("operation")) != null)
                operation = new String(omElement.getAttribute(new QName("operation")).getAttributeValue());      //attention-  consider about namespace

            setName(partnerLink + "." + operation);
            // Set Icon and Size
            startIconPath = org.wso2.carbon.bpel.ui.bpel2svg.BPEL2SVGFactory.getInstance().getIconPath(this.getClass().getName());
            endIconPath = BPEL2SVGFactory.getInstance().getEndIconPath(this.getClass().getName());
    View Full Code Here

    Examples of javax.xml.namespace.QName

            setParent(parent);

            String partnerLink = null;
            String operation = null;
            // Get Partner Link Name
            if (omElement.getAttribute(new QName("partnerLink")) != null)
                partnerLink = new String(omElement.getAttribute(new QName("partnerLink")).getAttributeValue());      //attention-  consider about namespace
            if (omElement.getAttribute(new QName("operation")) != null)
                operation = new String(omElement.getAttribute(new QName("operation")).getAttributeValue());      //attention-  consider about namespace

            setName(partnerLink + "." + operation);
            // Set Icon and Size
            startIconPath = org.wso2.carbon.bpel.ui.bpel2svg.BPEL2SVGFactory.getInstance().getIconPath(this.getClass().getName());
            endIconPath = BPEL2SVGFactory.getInstance().getEndIconPath(this.getClass().getName());
    View Full Code Here

    Examples of javax.xml.namespace.QName

         */
        public EndpointDefinition createDefinition(OMElement elem) {
            EndpointDefinition definition = new EndpointDefinition();

            OMAttribute optimize
                    = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "optimize"));
            OMAttribute encoding
                    = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "encoding"));

            OMAttribute trace = elem.getAttribute(new QName(
                    XMLConfigConstants.NULL_NAMESPACE, XMLConfigConstants.TRACE_ATTRIB_NAME));
            if (trace != null && trace.getAttributeValue() != null) {
                String traceValue = trace.getAttributeValue();
                if (XMLConfigConstants.TRACE_ENABLE.equals(traceValue)) {
                    definition.setTraceState(SynapseConstants.TRACING_ON);
                } else if (XMLConfigConstants.TRACE_DISABLE.equals(traceValue)) {
                    definition.setTraceState(SynapseConstants.TRACING_OFF);
                }
            } else {
                definition.setTraceState(SynapseConstants.TRACING_UNSET);
            }


            if (optimize != null && optimize.getAttributeValue().length() > 0) {
                String method = optimize.getAttributeValue().trim();
                if ("mtom".equalsIgnoreCase(method)) {
                    definition.setUseMTOM(true);
                } else if ("swa".equalsIgnoreCase(method)) {
                    definition.setUseSwa(true);
                }
            }

            if (encoding != null && encoding.getAttributeValue() != null) {
                definition.setCharSetEncoding(encoding.getAttributeValue());
            }

            OMElement wsAddr = elem.getFirstChildWithName(
                    new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "enableAddressing"));
            if (wsAddr != null) {

                definition.setAddressingOn(true);

                OMAttribute version = wsAddr.getAttribute(new QName("version"));
                if (version != null && version.getAttributeValue() != null) {
                    String versionValue = version.getAttributeValue().trim().toLowerCase();
                    if (SynapseConstants.ADDRESSING_VERSION_FINAL.equals(versionValue) ||
                            SynapseConstants.ADDRESSING_VERSION_SUBMISSION.equals(versionValue)) {
                        definition.setAddressingVersion(version.getAttributeValue());
                    } else {
                        handleException("Unknown value for the addressing version. Possible values " +
                                "for the addressing version are 'final' and 'submission' only.");
                    }
                }

                String useSepList = wsAddr.getAttributeValue(new QName("separateListener"));
                if (useSepList != null) {
                    if ("true".equals(useSepList.trim().toLowerCase())) {
                        definition.setUseSeparateListener(true);
                    }
                }
            }

            OMElement wsSec = elem.getFirstChildWithName(
                    new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "enableSec"));
            if (wsSec != null) {

                definition.setSecurityOn(true);

                OMAttribute policyKey      = wsSec.getAttribute(
                        new QName(XMLConfigConstants.NULL_NAMESPACE, "policy"));
                OMAttribute inboundPolicyKey  = wsSec.getAttribute(
                        new QName(XMLConfigConstants.NULL_NAMESPACE, "inboundPolicy"));
                OMAttribute outboundPolicyKey = wsSec.getAttribute(
                        new QName(XMLConfigConstants.NULL_NAMESPACE, "outboundPolicy"));

                if (policyKey != null && policyKey.getAttributeValue() != null) {
                    definition.setWsSecPolicyKey(policyKey.getAttributeValue());
                } else {
                    if (inboundPolicyKey != null && inboundPolicyKey.getAttributeValue() != null) {
                        definition.setInboundWsSecPolicyKey(inboundPolicyKey.getAttributeValue());
                    }
                    if (outboundPolicyKey != null && outboundPolicyKey.getAttributeValue() != null) {
                        definition.setOutboundWsSecPolicyKey(outboundPolicyKey.getAttributeValue());
                    }
                }
            }

            OMElement wsRm = elem.getFirstChildWithName(
                    new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "enableRM"));
            if (wsRm != null) {

                definition.setReliableMessagingOn(true);

                OMAttribute policy
                        = wsRm.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "policy"));
                if (policy != null) {
                    definition.setWsRMPolicyKey(policy.getAttributeValue());
                }
            }

            // set the timeout configuration
            OMElement timeout = elem.getFirstChildWithName(
                    new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "timeout"));
            if (timeout != null) {
                OMElement duration = timeout.getFirstChildWithName(
                        new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "duration"));

                if (duration != null) {
                    String d = duration.getText();
                    if (d != null) {
                        try {
                            long timeoutMilliSeconds = Long.parseLong(d.trim());
                            definition.setTimeoutDuration(timeoutMilliSeconds);
                        } catch (NumberFormatException e) {
                            handleException("Endpoint timeout duration expected as a " +
                                    "number but was not a number");
                        }
                    }
                }

                OMElement action = timeout.getFirstChildWithName(
                        new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "responseAction"));
                if (action != null && action.getText() != null) {
                    String actionString = action.getText();
                    if ("discard".equalsIgnoreCase(actionString.trim())) {

                        definition.setTimeoutAction(SynapseConstants.DISCARD);

                        // set timeout duration to 30 seconds, if it is not set explicitly
                        if (definition.getTimeoutDuration() == 0) {
                            definition.setTimeoutDuration(30000);
                        }
                    } else if ("fault".equalsIgnoreCase(actionString.trim())) {

                        definition.setTimeoutAction(SynapseConstants.DISCARD_AND_FAULT);

                        // set timeout duration to 30 seconds, if it is not set explicitly
                        if (definition.getTimeoutDuration() == 0) {
                            definition.setTimeoutDuration(30000);
                        }
                    } else if ("".equalsIgnoreCase(actionString.trim())) {
                        // if the timeout action is empty, then the action is set to DISCARD_AND_FAULT
                        definition.setTimeoutAction(SynapseConstants.DISCARD_AND_FAULT);

                        // set timeout duration to 30 seconds, if it is not set explicitly
                        if (definition.getTimeoutDuration() == 0) {
                            definition.setTimeoutDuration(30000);
                        }
                    } else {
                        handleException("Invalid timeout action, action : "
                                + actionString + " is not supported");
                    }
                }
            }

            OMElement markAsTimedOut = elem.getFirstChildWithName(new QName(
                SynapseConstants.SYNAPSE_NAMESPACE,
                XMLConfigConstants.MARK_FOR_SUSPENSION));

            if (markAsTimedOut != null) {

                OMElement timeoutCodes = markAsTimedOut.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.ERROR_CODES));
                if (timeoutCodes != null && timeoutCodes.getText() != null) {
                    StringTokenizer st = new StringTokenizer(timeoutCodes.getText().trim(), ", ");
                    while (st.hasMoreTokens()) {
                        String s = st.nextToken();
                        try {
                            definition.addTimeoutErrorCode(Integer.parseInt(s));
                        } catch (NumberFormatException e) {
                            handleException("The timeout error codes should be specified " +
                                "as valid numbers separated by commas : " + timeoutCodes.getText(), e);
                        }
                    }
                }

                OMElement retriesBeforeSuspend = markAsTimedOut.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.RETRIES_BEFORE_SUSPENSION));
                if (retriesBeforeSuspend != null && retriesBeforeSuspend.getText() != null) {
                    try {
                        definition.setRetriesOnTimeoutBeforeSuspend(
                            Integer.parseInt(retriesBeforeSuspend.getText().trim()));
                    } catch (NumberFormatException e) {
                        handleException("The retries before suspend [for timeouts] should be " +
                            "specified as a valid number : " + retriesBeforeSuspend.getText(), e);
                    }
                }

                OMElement retryDelay = markAsTimedOut.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.RETRY_DELAY));
                if (retryDelay != null && retryDelay.getText() != null) {
                    try {
                        definition.setRetryDurationOnTimeout(
                            Integer.parseInt(retryDelay.getText().trim()));
                    } catch (NumberFormatException e) {
                        handleException("The retry delay for timeouts should be specified " +
                            "as a valid number : " + retryDelay.getText(), e);
                    }
                }
            }

            // support backwards compatibility with Synapse 1.2 - for suspendDurationOnFailure
            OMElement suspendDurationOnFailure = elem.getFirstChildWithName(new QName(
                SynapseConstants.SYNAPSE_NAMESPACE, "suspendDurationOnFailure"));
            if (suspendDurationOnFailure != null && suspendDurationOnFailure.getText() != null) {

                log.warn("Configuration uses deprecated style for endpoint 'suspendDurationOnFailure'");
                try {
                    definition.setInitialSuspendDuration(
                            1000 * Long.parseLong(suspendDurationOnFailure.getText().trim()));
                    definition.setSuspendProgressionFactor((float) 1.0);
                } catch (NumberFormatException e) {
                    handleException("The initial suspend duration should be specified " +
                        "as a valid number : " + suspendDurationOnFailure.getText(), e);
                }
            }

            OMElement suspendOnFailure = elem.getFirstChildWithName(new QName(
                SynapseConstants.SYNAPSE_NAMESPACE,
                XMLConfigConstants.SUSPEND_ON_FAILURE));

            if (suspendOnFailure != null) {

                OMElement suspendCodes = suspendOnFailure.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.ERROR_CODES));
                if (suspendCodes != null && suspendCodes.getText() != null) {

                    StringTokenizer st = new StringTokenizer(suspendCodes.getText().trim(), ", ");
                    while (st.hasMoreTokens()) {
                        String s = st.nextToken();
                        try {
                            definition.addSuspendErrorCode(Integer.parseInt(s));
                        } catch (NumberFormatException e) {
                            handleException("The suspend error codes should be specified " +
                                "as valid numbers separated by commas : " + suspendCodes.getText(), e);
                        }
                    }
                }

                OMElement initialDuration = suspendOnFailure.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.SUSPEND_INITIAL_DURATION));
                if (initialDuration != null && initialDuration.getText() != null) {
                    try {
                        definition.setInitialSuspendDuration(
                            Integer.parseInt(initialDuration.getText().trim()));
                    } catch (NumberFormatException e) {
                        handleException("The initial suspend duration should be specified " +
                            "as a valid number : " + initialDuration.getText(), e);
                    }
                }

                OMElement progressionFactor = suspendOnFailure.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.SUSPEND_PROGRESSION_FACTOR));
                if (progressionFactor != null && progressionFactor.getText() != null) {
                    try {
                        definition.setSuspendProgressionFactor(
                            Float.parseFloat(progressionFactor.getText().trim()));
                    } catch (NumberFormatException e) {
                        handleException("The suspend duration progression factor should be specified " +
                            "as a valid float : " + progressionFactor.getText(), e);
                    }
                }

                OMElement maximumDuration = suspendOnFailure.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE,
                    XMLConfigConstants.SUSPEND_MAXIMUM_DURATION));
                if (maximumDuration != null && maximumDuration.getText() != null) {
                    try {
                        definition.setSuspendMaximumDuration(
                            Long.parseLong(maximumDuration.getText().trim()));
                    } catch (NumberFormatException e) {
                        handleException("The maximum suspend duration should be specified " +
                            "as a valid number : " + maximumDuration.getText(), e);
                    }
                }
            }

            OMElement retryConfig = elem.getFirstChildWithName(new QName(
                SynapseConstants.SYNAPSE_NAMESPACE, XMLConfigConstants.RETRY_CONFIG));

            if (retryConfig != null) {

                OMElement retryDisabledErrorCodes = retryConfig.getFirstChildWithName(new QName(
                    SynapseConstants.SYNAPSE_NAMESPACE, "disabledErrorCodes"));
                if (retryDisabledErrorCodes != null && retryDisabledErrorCodes.getText() != null) {

                    StringTokenizer st = new StringTokenizer(
                            retryDisabledErrorCodes.getText().trim(), ", ");
    View Full Code Here

    Examples of javax.xml.namespace.QName

        public OMElement serializeEndpoint(Endpoint epr) {
            TemplateEndpoint endpoints = (TemplateEndpoint) epr;

            OMElement endpointElement = fac.createOMElement(
                    new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint"));

            if (endpoints.getName() != null) {
                endpointElement.addAttribute(
                        fac.createOMAttribute("name", nullNS, endpoints.getName()));
            }

            endpointElement.addAttribute(fac.createOMAttribute("template", nullNS, endpoints.getTemplate()));

            Map<String, String> parameters = endpoints.getParameters();
            for (Map.Entry<String, String> entry : parameters.entrySet()) {
                if (entry.getKey().equals("name")) {
                    endpointElement.addAttribute(fac.createOMAttribute("name", nullNS, entry.getValue()));
                } else if (entry.getKey().equals("uri")) {
                    endpointElement.addAttribute(fac.createOMAttribute("uri", nullNS, entry.getValue()));
                } else {
                    OMElement paramElement = fac.createOMElement(
                        new QName(SynapseConstants.SYNAPSE_NAMESPACE, "parameter"));

                    endpointElement.addChild(paramElement);
                    paramElement.addAttribute(fac.createOMAttribute("name", nullNS, entry.getKey()));
                    paramElement.addAttribute(fac.createOMAttribute("value", nullNS, entry.getValue()));
                }
    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.