docs: public Selector parseSelector(String selectorString,
                                  SelectorDomain domain)
      throws SISelectorSyntaxException
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "parseSelector", new Object[] { selectorString, domain });
  
      Selector selectorTree = null;
      Transformer transformer = Matching.getTransformer();
      Resolver resolver = null;
  
      try
      {
        // Synchronization block to protect the parser object from being reset
        // whilst in use.
        synchronized (this)
        {
          MatchParser parser = null;
          if(domain.equals(SelectorDomain.JMS))
          {
            // Set the correct resolver
            resolver = _jmsResolver;
            // Drive the parser
            _sibParser = _matching.primeMatchParser(_sibParser,
                                               selectorString,
                                               SelectorDomain.JMS.toInt());
            parser = _sibParser;
          }
          else if(domain.equals(SelectorDomain.SIMESSAGE))
          {
            // Set the correct resolver
            resolver = _simessageResolver;
            // Drive the parser
            _sibParser = _matching.primeMatchParser(_sibParser,
                                               selectorString,
                                               SelectorDomain.SIMESSAGE.toInt());
            parser = _sibParser;
          }
          else // In the XPath1.0 case we use the default resolver
          {
            // Set the correct resolver
            resolver = _defaultResolver;
            // Drive the parser
            _xpathParser = _matching.primeMatchParser(_xpathParser,
                                               selectorString,
                                               SelectorDomain.XPATH1.toInt());
            parser = _xpathParser;
          }
  
          // We're ready to parse the selector
          if(disableXPathOptimizer && domain.equals(SelectorDomain.XPATH1))
          {
            // In this special case we'll disable the MatchSpace XPath
            // optimizations and process XPath expressions as whole entities.
            XPath10Parser xpParser = (XPath10Parser)parser;
            selectorTree = xpParser.parseWholeSelector(selectorString);
          }
          else
          {
            // Parse in the usual manner
            selectorTree = parser.getSelector(selectorString);
          }
  
          // Check that the selector parsed ok.
          if (selectorTree.getType() == Selector.INVALID)
          {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
            throw new SISelectorSyntaxException(
              nls.getFormattedMessage(
                "INVALID_SELECTOR_ERROR_CWSIP0371",
                new Object[] { selectorString },
                null));
          }
  
          selectorTree = transformer.resolve(selectorTree, resolver, _positionAssigner);
  
          // Check that the selector resolved ok.
          if (selectorTree.getType() == Selector.INVALID)
          {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
            throw new SISelectorSyntaxException(
              nls.getFormattedMessage(
                "INVALID_SELECTOR_ERROR_CWSIP0371",
                new Object[] { selectorString },
                null));
          }
        }
      }
      catch (RuntimeException e)
      {
        // FFDC
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.parseSelector",
          "1:1741:1.117.1.11",
          this);
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
  
        throw new SISelectorSyntaxException(
          nls.getFormattedMessage(
            "INVALID_SELECTOR_ERROR_CWSIP0371",
            new Object[] { null },
            null));
      }
      catch (MatchingException e)
      {
        // No FFDC code needed
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
  
        throw new SISelectorSyntaxException(
          nls.getFormattedMessage(
            "INVALID_SELECTOR_ERROR_CWSIP0376",
            new Object[] { e },
            null));
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "parseSelector", selectorTree);
      return selectorTree;
    }