docs: @Override
      public ConsumerManager chooseConsumerManager(
                                                   DestinationDefinition definition,
                                                   boolean isReceiveAllowed,
                                                   SIBUuid12 gatheringTargetUuid,
                                                   SIBUuid8 fixedMEUuid,
                                                   HashSet<SIBUuid8> scopedMEs)
                      throws SIResourceException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc,
                          "chooseConsumerManager",
                          new Object[] {
                                        definition,
                                        Boolean.valueOf(isReceiveAllowed),
                                        gatheringTargetUuid,
                                        fixedMEUuid,
                                        scopedMEs });
  
          ConsumerManager consumerManager = null;
          boolean localCDAllowed = false;
          boolean gatherMessages = gatheringTargetUuid != null;
  
          // If we're fixed to a single ME we can't be a 'gathering' consumer
          if (fixedMEUuid != null)
          {
              gatherMessages = false;
  
              // Are we allowed to look for a local ConsumerDispatcher?
              if (fixedMEUuid.equals(_messageProcessor.getMessagingEngineUuid()))
                  localCDAllowed = true;
          }
          else if (scopedMEs != null)
          {
              if (scopedMEs.contains(_messageProcessor.getMessagingEngineUuid()))
                  localCDAllowed = true;
          }
          else
              localCDAllowed = true;
  
          // First look for a local ConsumerDispatcher (if we're allowed to)
          if ((gatherMessages || isReceiveAllowed) && localCDAllowed)
          {
              consumerManager =
                              getLocalPtoPConsumerManager();
          }
  
          //No local consumer dispatcher is available,
          if (consumerManager == null)
          {
              SIBUuid8 dmeUuid = null;
  
              // Look in WLM to see if a remote queue point can be found (unless we're fixed
              // to only the local one
              if ((fixedMEUuid == null) || !localCDAllowed)
                  dmeUuid = _localisationManager.chooseRemoteQueuePoint(fixedMEUuid, scopedMEs);
  
              // If we found a remote one then we'll use it
              if (dmeUuid != null)
              {
                  // If we have no local queue point but gather is set to true then we are a remote gatherer so
                  // set the appropriate gathering uuid in the streams
  
                  AnycastInputHandler aih = _remoteSupport.
                                  getAnycastInputHandler(dmeUuid,
                                                         gatheringTargetUuid,
                                                         definition,
                                                         true); //create if necessary
                  consumerManager = aih.getRCD();
              }
              // Otherwise, return the local one (if allowed)
              else if (localCDAllowed)
              {
                  //Return the local (possibly get inhibited consumer dispatcher if
                  //there is no other choice
                  consumerManager =
                                  getLocalPtoPConsumerManager();
  
                  if (consumerManager == null)
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(tc, "chooseConsumerManager", null);
  
                      //TODO This exception if fixed????
                      throw new SIResourceException(
                                      nls_cwsik.getFormattedMessage(
                                                                    "DELIVERY_ERROR_SIRC_26", // NO_LOCALISATIONS_FOUND_ERROR_CWSIP0032
                                                                    new Object[] { _baseDestinationHandler.getName() },
                                                                    null));
                  }
              }
          }
          else if (gatherMessages) // We are a local message gathering consumer
          {
              if (gatheringConsumerDispatcher == null)
                  gatheringConsumerDispatcher = new HashMap<SIBUuid12, GatheringConsumerDispatcher>();
  
              GatheringConsumerDispatcher gcd = gatheringConsumerDispatcher.get(gatheringTargetUuid);
              if (gcd == null)
              {
                  gcd = new GatheringConsumerDispatcher(_baseDestinationHandler, getLocalPtoPConsumerManager());
  
                  // Synchronize to ensure that we don't miss any change notifications between obtaining the current
                  // set of localising messaging engines and creating all the AnycastInputHandler instances
                  synchronized (gcd)
                  {
                      // Create a GatheringConsumerDispatcher instance initially with no remote consumer dispatchers
                      gatheringConsumerDispatcher.put(gatheringTargetUuid, gcd);
  
                      // Register to receive notification of changes in destination localisation sets
                      gcd.registerChangeListener(scopedMEs, _baseDestinationHandler.getUuid(), definition, _remoteSupport);
  
                      // Get all currently "up" Me
                      Set<SIBUuid8> localisations = _localisationManager.getAllGetLocalisations();
  
                      Iterator<SIBUuid8> it = localisations.iterator();
                      while (it.hasNext())
                      {
                          final SIBUuid8 meUuid = it.next();
                          if (!meUuid.equals(_messageProcessor.getMessagingEngineUuid()) &&
                              (scopedMEs == null || (scopedMEs != null && scopedMEs.contains(meUuid))))
                          { // Our own uuid is not remote!
                              final AnycastInputHandler aih = _remoteSupport.getAnycastInputHandler(meUuid, null, definition, true);
                              gcd.addRemoteCD(meUuid, aih.getRCD());
                          }
                      }
                  }
              }
              consumerManager = gcd;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "chooseConsumerManager", consumerManager);
  
          return consumerManager;
      }