Mark the DestinationHandler for deletion.
328053
public void setToBeDeleted(boolean delete)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setToBeDeleted", Boolean.valueOf(delete));

        _toBeDeleted = delete;

        if (delete)
        {
            // Tell the associated statistics that they should disappear.
            if (_protoRealization != null)
                _protoRealization.setToBeDeleted();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setToBeDeleted");
    }
390172
public void destinationLocationChange (SIBUuid12 destId, Set additions, Set deletions, Capability capability)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "destinationLocationChange",
        new Object[]{destId, additions, deletions, capability});

    BaseDestinationHandler destinationHandler =
      (BaseDestinationHandler) _destinationManager.getDestinationInternal(destId, false);

    if (destinationHandler != null)
    {

      // Check if the localisation should be deleted
      Set localitySet = getDestinationLocalitySet(destinationHandler, capability);
      
      synchronized(destinationHandler)
      {
        // d526250 - If a remote destination is deleted then its ME stopped we might
        // get a trm notification in. Meanwhile, admin has told us to delete the dest
        // already. If we dont do the following we end up performing cleanup on a 
        // dest that no longer exists and we get nullpointers.
        if (!destinationHandler.isToBeDeleted())
        {
          // Process deletions from the WLM set for the destination
          // (No requirement to react to additions)
          Iterator i = deletions.iterator();
  
          while(i.hasNext())
          {
            SIBUuid8 meUuid = (SIBUuid8) i.next();
  
            //No point reacting to our own ME uuid
            if (!(meUuid.equals(_messageProcessor.getMessagingEngineUuid())))
            {
              PtoPMessageItemStream ptoPMessageItemStream;
  
                ptoPMessageItemStream = destinationHandler.getXmitQueuePoint(meUuid);
  
              // Dont touch a localisation that doesnt exist
              if (ptoPMessageItemStream != null)
              {
                if ((localitySet == null) || !localitySet.contains(meUuid.toString()))
                {
                  // The localisation is not known in WCCM or WLM, so mark it for deletion
                  cleanupDestination(ptoPMessageItemStream, 
                      destinationHandler,
                      meUuid,
                      capability);
                }
              }
            }
          }

          if (capability != Capability.GET)
          {
            // Reallocate the transmitQs to evenly spread messages
            destinationHandler.requestReallocation();
          }
        }
      }
    }
    
    // Iterate over the registered MP listeners and alert them to the location change
    for (int i = 0; i < _destinationChangeListeners.size(); i++)
    {
      MPDestinationChangeListener listener = _destinationChangeListeners.get(i);
      if (listener != null)
        listener.destinationLocationChange(destId, additions, deletions, capability);
    }

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

    return;
  }
466369
@Deprecated
    public static void markForDeletion(UIComponent component)
    {
        // flag this component as deleted
        component.getAttributes().put(MARK_DELETED, Boolean.TRUE);

        Iterator<UIComponent> iter = component.getFacetsAndChildren();
        while (iter.hasNext())
        {
            UIComponent child = iter.next();
            if (child.getAttributes().containsKey(MARK_CREATED))
            {
                child.getAttributes().put(MARK_DELETED, Boolean.TRUE);
            }
        }
    }
470548
public void reconstitute(BaseDestinationHandler destinationHandler) throws SIResourceException
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", destinationHandler); 

    super.reconstitute(destinationHandler);
      
    if (tc.isEntryEnabled())
    {
      SibTr.exit(tc, "reconstitute");           
    }
  }
253256
public void removeHandlers() {
    Iterator<HandlerRegistration> it = registrations.iterator();
    while (it.hasNext()) {
      HandlerRegistration r = it.next();

      /*
       * must remove before we call removeHandler. Might have come from nested
       * ResettableEventBus
       */
      it.remove();

      r.removeHandler();
    }
  }
133195
public final void removePseudoDestination(SIBUuid12 destinationUuid)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "removePseudoDestination", destinationUuid);
        destinationIndex.removePseudoUuid(destinationUuid);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "removePseudoDestination");
    }
853326
protected void activateDestination(DestinationHandler dh)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "activateDestination", dh);

        if (dh.isLink())
        {
            linkIndex.create(dh);
        }
        else
        {
            destinationIndex.create(dh);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "activateDestination");
    }
282197
void topicSpaceDeleted(DestinationHandler destination) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "topicSpaceDeleted", destination);

    // Synchronize around the topic space references to stop removal and
    // additions occuring at the same time. 
    synchronized (_topicSpaces)
    {
      // Get the list of the different PubSubOutputHandlers from the Destination
      // Clone the list as the original is locked
      final HashMap pubsubOutputHandlers = (HashMap)(destination.getAllPubSubOutputHandlers()).clone();
      
      // Unlock the list as leaving it locked results in deadlock
      destination.unlockPubsubOutputHandlers();

      // Check that there are some output handlers as they may have all been 
      // removed or none have ever been created on this topicSpace destination
      if (pubsubOutputHandlers != null && pubsubOutputHandlers.size() > 0)
      {
        final ArrayList topicSpacesDeleted = new ArrayList();
        final ArrayList topicsDeleted = new ArrayList();

        // Get the set of keys from the pubsubOutputHandlers which is infact the
        // list of meNames
        final Iterator neighbourUuids = pubsubOutputHandlers.keySet().iterator();

        // Iterate over the list of meNames
        while (neighbourUuids.hasNext())
        {
          // Reset the created topicSpaces
          topicSpacesDeleted.clear();

          // Reset the created topics
          topicsDeleted.clear();

          // Get the next me Name
          final SIBUuid8 neighbourUuid = (SIBUuid8) neighbourUuids.next();

          // Get the PubSubOutputHandler associated with this ME.
          final PubSubOutputHandler handler =
            (PubSubOutputHandler) pubsubOutputHandlers.get(neighbourUuid);

          final String topics[] = handler.getTopics();
          
          Neighbour neighbour = getNeighbour(neighbourUuid);
          
          // In the case that this neighbour is recovered, but not activated,
          // this neighbour should be got from the recovered list
          boolean warmRestarted = false;
          if (neighbour == null)
          {          
            synchronized(_recoveredNeighbours)
            {
              neighbour = (Neighbour)_recoveredNeighbours.get(neighbourUuid);
            }
            warmRestarted = true;
          } 
          
          // Cycle through the topics removing each one from this ME.
          // but only if there are topics to remove.
          if ( neighbour != null && topics != null)
          {
            for (int i = 0; i < topics.length; i++)
            {              
              // Remove this Handler from the MatchSpace 
              if (!warmRestarted)
              {
                MESubscription meSub = neighbour.getSubscription(destination.getUuid(), topics[i]);
              
                ControllableProxySubscription sub = meSub.getMatchspaceSub();              
                _proxyHandler
                  .getMessageProcessor()
                  .getMessageProcessorMatching()
                  .removePubSubOutputHandlerMatchTarget(sub);
                  
                destination.getSubscriptionIndex().remove(sub);
              }  
              
              // Remove the topic from the referenced topics in the handler.
              handler.removeTopic(topics[i]);
  
              // Add a reference into the reference list so when a delete arrives
              // The proxy can be removed.
              addTopicSpaceReference(neighbourUuid, destination.getUuid(), topics[i], warmRestarted);
  
              // Add the topicSpace and topic to the set of deleted topics.
              topicSpacesDeleted.add(destination.getUuid());
              topicsDeleted.add(topics[i]);
            }
          }
          
          // Having cleaned all the topics out from the handler
          // delete the handler.
          destination.deletePubSubOutputHandler(neighbourUuid);                                        
          
          
          // Publish the deleted event for the deleted topics on the topic space
          if ( neighbour!= null )
            _proxyHandler.unsubscribeEvent(
              topicSpacesDeleted,
              topicsDeleted,
              neighbour.getBusId(),
              null);
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "topicSpaceDeleted");
  }
1323953
public void markAsToBeDeleted(Transaction transaction) throws SIResourceException 
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "markAsToBeDeleted", transaction);
      
    toBeDeleted = Boolean.TRUE;  
    
    try
    {
      requestUpdate(transaction);
    }
    catch (MessageStoreException e)
    {
      // MessageStoreException shouldn't occur so FFDC.
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.MQLinkPubSubBridgeItemStream.markAsToBeDeleted",
        "1:151:1.16",
        this);
        
      SibTr.exception(tc, e);
      
      if (tc.isEntryEnabled())
        SibTr.exit(tc, "markAsToBeDeleted", e);
      
      throw new SIResourceException(e);
    }
    
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "markAsToBeDeleted");
      
    return;
  }
1022646
def _handleDelete(self):
        
        if self.cursorPos < len(self.inputBuffer):
            self.inputBuffer = self.inputBuffer[0:self.cursorPos] + self.inputBuffer[self.cursorPos+1:]                        
            self._refreshInputPrompt(len(self.inputBuffer)+1)
933275
def _handle_delete(self, method, remainder, request=None):
        '''
        
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_delete)

        if remainder:
            match = self._handle_custom_action(method, remainder, request)
            if match:
                return match

            controller = self._lookup_child(remainder[0])
            if controller and not ismethod(controller):
                return lookup_controller(controller, remainder[1:], request)

        # check for post_delete/delete requests first
        controller = self._find_controller('post_delete', 'delete')
        if controller:
            return controller, remainder

        # if no controller exists, try routing to a sub-controller; note that
        # since this is a DELETE verb, any local exposes are 405'd
        if remainder:
            if self._find_controller(remainder[0]):
                abort(405)
            sub_controller = self._lookup_child(remainder[0])
            if sub_controller:
                return lookup_controller(sub_controller, remainder[1:],
                                         request)

        abort(405)
851760
def _delete_handler(self, handler_class):
        """"""
        to_remove = self._get_handler(handler_class)
        if not to_remove:
            logging.warning('Error we should have an element to remove')
        else:
            self.handlers.remove(to_remove)
            self.logger.removeHandler(to_remove)
589325
private void cascadeMarkedForDeletion()
    {
        List alreadyPrepared = new ArrayList();
        for(int i = 0; i < markedForDeletionList.size(); i++)
        {
            ObjectEnvelope mod = (ObjectEnvelope) markedForDeletionList.get(i);
            // if the object wasn't associated with another object, start cascade delete
            if(!isNewAssociatedObject(mod.getIdentity()))
            {
                cascadeDeleteFor(mod, alreadyPrepared);
                alreadyPrepared.clear();
            }
        }
        markedForDeletionList.clear();
    }
1080870
private void purgeHandle(String handle) {
        write.lock();
        try {
            kamMap.remove(handle);

            Set<Entry<FilteredKAMKey, String>> entries = fltrdMap.entrySet();
            Iterator<Entry<FilteredKAMKey, String>> iter = entries.iterator();
            while (iter.hasNext()) {
                Entry<FilteredKAMKey, String> next = iter.next();
                if (handle.equals(next.getValue())) {
                    iter.remove();
                }
            }

            Set<Entry<KamInfo, String>> entries2 = unfltrdMap.entrySet();
            Iterator<Entry<KamInfo, String>> iter2 = entries2.iterator();
            while (iter2.hasNext()) {
                Entry<KamInfo, String> next = iter2.next();
                if (handle.equals(next.getValue())) {
                    iter2.remove();
                }
            }
        } finally {
            write.unlock();
        }
    }
720669
public void delete()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "delete");
        //Tell the target of the alias to remove the backwards reference to it
        _targetDestinationHandler.removeTargettingAlias(this);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "delete");
    }
157757
private void cleanupDestination(PtoPMessageItemStream ptoPMessageItemStream, 
                                  BaseDestinationHandler destinationHandler,
                                  SIBUuid8 meUuid,
                                  Capability capability)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "cleanupDestination",
        new Object[]{ptoPMessageItemStream, destinationHandler, meUuid, capability});
    
    // The localisation is not known in WCCM or WLM, so mark it for deletion
    try
    {
      ptoPMessageItemStream.markAsToBeDeleted(_txManager.createAutoCommitTransaction());
          //Capability == GET Close any remote consumers from the destination
          destinationHandler.closeRemoteConsumer(meUuid);
    }
    catch(SIResourceException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.DestinationChangeListener.cleanupDestination",
        "1:424:1.45",
        this);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "cleanupDestination");    
  }
687056
protected void closeBrowsersDestinationDeleted(DestinationHandler destinationHandler)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(this, tc, "closeBrowsersDestinationDeleted", destinationHandler);

    synchronized (_browsers)
    {
      Iterator<BrowserSessionImpl> i = _browsers.iterator();
      closing = true;
      
      while (i.hasNext())
      {
        // Close the producer session, indicating that it has been closed due to delete
        boolean closedOk = i.next()._closeBrowserDestinationDeleted(destinationHandler);

        // Remove the producer session from the Producers List
        if (closedOk) 
          i.remove();
      }
      
      closing = false;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(this, tc, "closeBrowsersDestinationDeleted");
  }