code: public boolean registerConsumerSetMonitor(
      DestinationHandler topicSpace,
      String discriminatorExpression,
      ConnectionImpl connection,
      ConsumerSetChangeCallback callback)
    throws
        SIDiscriminatorSyntaxException,
        SIErrorException
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.entry(
            tc,
            "registerConsumerSetMonitor",
            new Object[] { topicSpace, discriminatorExpression, connection, callback });
  
      boolean isWildcarded = isWildCarded(discriminatorExpression);
  
      // Get the uuid for the topicspace
      SIBUuid12 topicSpaceUuid = topicSpace.getBaseUuid();
      String topicSpaceStr = topicSpaceUuid.toString();
      // Combine the topicSpace and topic
      String tExpression = buildAddTopicExpression(topicSpaceStr, discriminatorExpression);
  
      String wildcardStem = null;
      if(isWildcarded)
      {
        // Retrieve the non-wildcarded stem
        wildcardStem = retrieveNonWildcardStem(tExpression);
      }
  
      boolean areConsumers = false;
  
      // Register under a lock on the targets table
      synchronized(_targets)
      {
        areConsumers =
          _consumerMonitoring.registerConsumerSetMonitor(connection,
                                                         topicSpace,
                                                         topicSpaceUuid,
                                                         discriminatorExpression,
                                                         tExpression,
                                                         callback,
                                                         isWildcarded,
                                                         wildcardStem,
                                                         this);
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "registerConsumerSetMonitor", Boolean.valueOf(areConsumers));
      return areConsumers;
    }
docs: Method registerConsumerSetMonitor
  
  Checks whether there are any potential consumers for messages published on the
  specified topic(s). The potential set will be determined using an optimistic
  approach that caters for wildcards and selectors by returning true if there is
  any possibility of a match.
  
  Additionally registers a callback that will be driven when the potential set of
  consumers drops to zero or rises above zero.
  
  Returns true if the potential set of consumers is currently greater than zero,
  false if it is zero.
  
  @param topicSpace
  @param discriminatorExpression
  @param callback
  @return
  @throws SIDiscriminatorSyntaxException
  @throws SIErrorException