Method removeConsumer

Remove a consumer from the Monitoring state

@param mc the consumer to be removed
@exception MatchingException if key undefined or on serious error
545015
public void removeConsumer(MonitoredConsumer mc)
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "removeConsumer", 
                  new Object[]{mc});
      
    boolean selector = mc.isSelector();
    boolean isWildcarded = mc.isWildcarded();
    String topic = mc.getTopic();
    ArrayList consumerList = 
      _subscriptionRegistrar.getConsumerListForExpression(topic, selector, isWildcarded);
        
    //TODO: handle empty return
        
    if (tc.isDebugEnabled())
      SibTr.debug(tc, "Found existing entry with list: " + consumerList +
                      ", of size: " + consumerList.size());
        
    // Remove the consumer      
    boolean removed = consumerList.remove(mc);
    if(!removed)
    {
      // Couldn't find the consumer. This means we have an internal 
      // inconsistency in our tables, so throw an SIErrorException
    
      if (tc.isEntryEnabled()) 
        SibTr.exit(tc, "removeConsumer", "SIErrorException");
      
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
        new Object[] {
          "com.ibm.ws.sib.processor.matching.ConsumerMonitoring",
          "1:248:1.7"
          });  
        
      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0001",
          new Object[] {
            "com.ibm.ws.sib.processor.matching.ConsumerMonitoring",
            "1:256:1.7"
          },
          null));      
    }          
                 
    // Only remove the row in the table from the subscription registrar
    // if this was the last consumer in the list
    if(consumerList.isEmpty())
    {
      _subscriptionRegistrar.removeConsumerListForExpression(topic,selector,isWildcarded);                  
    }
        
    // 1. Need to remove sub references from consumer monitor tables
    // 2. Drive callbacks where appropriate
    ArrayList exactMonitorList = (ArrayList)mc.getMatchingExactMonitorList();
    ArrayList wildcardMonitorList = (ArrayList)mc.getMatchingWildcardMonitorList();
        
    _consumerMonitorRegistrar.
      removeConsumerFromRegisteredMonitors(mc, exactMonitorList, wildcardMonitorList);
          
    if (tc.isEntryEnabled()) SibTr.exit(tc, "removeConsumer"); 
  }
244333
public void removeConsumerSetMonitors(ConnectionImpl connection)
  throws SINotPossibleInCurrentConfigurationException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeConsumerSetMonitors", new Object[] { connection });

    // Locate the connection in the callback index
    if(_callbackIndex.containsKey(connection))
    {
      // Have found registered callbacks for this connection
      Map connMap = (HashMap)_callbackIndex.get(connection);

      // Iterate through the map removing individual callbacks
      Iterator i = connMap.entrySet().iterator();
      while (i.hasNext())
      {
        Map.Entry entry = (Map.Entry)i.next();
        ConsumerSetChangeCallback callback = (ConsumerSetChangeCallback)entry.getKey();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          SibTr.debug(tc, "Found registered callback: " + callback);

        // Locate the TopicRecord for the callback
        TopicRecord tRecord = (TopicRecord)entry.getValue();
        if(tRecord != null)
        {
          // Have found the callback in the index, now remove the callback from
          // the appropriate registered monitors table.
          if(tRecord.isWildcarded)
          {
            removeCallbackFromRegisteredMonitors(callback,
                                                 tRecord.topicExpression,
                                                 true, // isWildcarded
                                                 _registeredWildcardConsumerMonitors);
          }
          else
          {
            // Handle the non-wildcard case
            removeCallbackFromRegisteredMonitors(callback,
                                                 tRecord.topicExpression,
                                                 false, // isWildcarded
                                                 _registeredExactConsumerMonitors);
          }
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeConsumerSetMonitors");
  }
1065517
boolean removeObserver(ApptentiveNotificationObserver observer) {
		int index = indexOf(observer);
		if (index != -1) {
			observers.remove(index);
			return true;
		}
		return false;
	}
24439
public function deleteConsumer ( $consumer_key, $user_id, $user_is_admin = false )
    {
        if ($user_is_admin)
        {
            $this->query('
                    DELETE FROM oauth_server_registry
                    WHERE osr_consumer_key = \'%s\'
                      AND (osr_usa_id_ref = \'%d\' OR osr_usa_id_ref IS NULL)
                    ', $consumer_key, $user_id);
        }
        else
        {
            $this->query('
                    DELETE FROM oauth_server_registry
                    WHERE osr_consumer_key = \'%s\'
                      AND osr_usa_id_ref   = \'%d\'
                    ', $consumer_key, $user_id);
        }
    }
961125
public void removeConsumerListForExpression(
    String topicExpression,
    boolean selector,
    boolean isWildcarded)
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "removeConsumerListForExpression", 
                  new Object[]{topicExpression, 
                               new Boolean(selector),
                               new Boolean(isWildcarded)});

    if(selector)
    {
      if(isWildcarded)
      {
        // Selector and wildcarded
        ArrayList consumerList = (ArrayList)_wildcardSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
          
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:265:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:272:1.5",
                topicExpression },
              null));                       
        }                          
        // Test whether table is now empty
        if(_wildcardSelectorSubs.isEmpty())
          _areWildcardSelectorSubs = false;
      }
      else
      {
        // Selector but not wildcarded
        ArrayList consumerList = (ArrayList)_exactSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:296:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:303:1.5",
                topicExpression },
              null));                       
        }                  
        // Test whether table is now empty
        if(_exactSelectorSubs.isEmpty())
          _areExactSelectorSubs = false;
      }
    }
    else
    {
      // No Selector expression
      if(isWildcarded)
      {
        // No selector and wildcarded
        ArrayList consumerList = (ArrayList)_wildcardNonSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:331:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:338:1.5",
                topicExpression },
              null));                       
        }                       
        // Test whether table is now empty
        if(_wildcardNonSelectorSubs.isEmpty())
          _areWildcardNonSelectorSubs = false;        
      }
      else
      {
        // No selector and not wildcarded
        ArrayList consumerList = (ArrayList)_exactNonSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:362:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:369:1.5",
                topicExpression },
              null));                       
        }                            
        // Test whether table is now empty
        if(_exactNonSelectorSubs.isEmpty())
          _areExactNonSelectorSubs = false;        
      }      
    }           
    if (tc.isEntryEnabled()) SibTr.exit(tc, "removeConsumerListForExpression");
  }
810614
public void unregisterConsumer( LocalMessageConsumer consumer )
    {
    	consumersLock.writeLock().lock();
    	try
    	{
    		localConsumers.remove(consumer);
    	}
    	finally
    	{
    		consumersLock.writeLock().unlock();
    	}
    }
313616
public void removeThreadLocalSQLAuditor(Consumer<String> observer)
	{
		List<Consumer<String>> observers = onPrepareStatementWatchers.get();

		observers.remove(observer);

		if (observers.isEmpty())
			onPrepareStatementWatchers.remove();
	}
682924
public void addConsumerToRegisteredMonitors(
    MonitoredConsumer mc,
    ArrayList exactMonitorList,
    ArrayList wildcardMonitorList)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(
          tc,
          "addConsumerToRegisteredMonitors",
          new Object[] { mc,
                         exactMonitorList,
                         wildcardMonitorList });
    // Add consumer to correct places in the maps
    addConsumerToRegisteredMonitorMap(mc, exactMonitorList, _registeredExactConsumerMonitors);

    // Now process the wildcard monitor list
    addConsumerToRegisteredMonitorMap(mc, wildcardMonitorList, _registeredWildcardConsumerMonitors);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addConsumerToRegisteredMonitors");

  }
662255
public void removeConsumerSetMonitors(ConnectionImpl connection)
  throws SINotPossibleInCurrentConfigurationException       
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "removeConsumerSetMonitors", new Object[] { connection });

    // Call the registrar
    _consumerMonitorRegistrar.removeConsumerSetMonitors(connection);

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "removeConsumerSetMonitors");
  }
504590
public void remove(Object pKey)
    {
        Identity id;
        if(pKey instanceof Identity)
        {
            id = (Identity) pKey;
        }
        else
        {
            id = transaction.getBroker().serviceIdentity().buildIdentity(pKey);
        }
        mhtObjectEnvelopes.remove(id);
        mvOrderOfIds.remove(id);
    }
15460
def remove_consumer_tag(self, tag=None):
        
        if tag is not None:
            if tag in self._consumer_tags:
                self._consumer_tags.remove(tag)
        else:
            self._consumer_tags = []
40243
void addConsumer(ConsumerSessionImpl consumer) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "addConsumer", consumer);

        _consumerList.add(consumer);

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "addConsumer");
    }
244620
@Override
    public boolean unregisterMonitor(Object annotatedObject) {
        // Clear the listener data
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "unregisteringMonitor =  " + annotatedObject);
        }
        Set<ProbeListener> listeners = removeListenersForMonitor(annotatedObject);
        if (listeners == null) {
            return false;
        }

        // Remove the listeners associated with the inactive monitor and
        // find out which classes need to be transformed to remove stale probes
        Collection<Class<?>> effectedClasses = processRemovedListeners(listeners);

        // Update the classes to remove dead probes (optional)
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "effectedClasses.size() =  " + effectedClasses.size());
        }
        this.transformer.instrumentWithProbes(effectedClasses);
        Set set = moduleInstanceToBundleMap.entrySet();
        Iterator i = set.iterator();
        while (i.hasNext()) {
            Map.Entry mapE = (Map.Entry) i.next();
            if (mapE != null && mapE.getValue().equals(annotatedObject.getClass().getName())) {
                PmiAbstractModule s = (PmiAbstractModule) mapE.getKey();
                s.unregister();
            }
        }
        return true;
    }
624747
public void setConsumerDispatcher(ConsumerDispatcher consumerDispatcher)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setConsumerDispatcher", consumerDispatcher);

        this.consumerDispatcher = consumerDispatcher;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setConsumerDispatcher");
    }
1033207
public void removeConsumerPointMatchTarget(DispatchableKey consumerPointData)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeConsumerPointMatchTarget", consumerPointData);

    // Remove the consumer point from the matchspace
    try
    {
      removeTarget(consumerPointData);
    }
    catch (MatchingException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerPointMatchTarget",
        "1:840:1.117.1.11",
        this);

      SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "removeConsumerPointMatchTarget", "SICoreException");

      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
      new Object[] {
        "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
        "1:851:1.117.1.11",
        e });

      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
            "1:859:1.117.1.11",
            e },
          null),
        e);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeConsumerPointMatchTarget");
  }
382702
void removeMember(MemberImpl member) {
        heartbeatFailureDetector.remove(member);
        if (icmpParallelMode) {
            icmpFailureDetector.remove(member);
        }
    }
90324
public boolean removeWatcher(Listener watcher) {
        if (watcher == null) {
            throw new IllegalArgumentException("Null watcher removed");
        }

        synchronized (mutex) {
            AtomicBoolean removed = new AtomicBoolean(removeFromListeners(watchers, watcher));
            watchedFiles.forEach((path, suppliers) -> {
                if (removeFromListeners(suppliers, watcher)) {
                    removed.set(true);
                }
            });
            return removed.get();
        }
    }