<p>Deregister the destination vith WLM via TRM</p>

System destinations and Temporary destinations are not registered
with WLM.  The destinations themselves have their own addressing
mechanisms.
423779
void deregisterDestination()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deregisterDestination");

    try
    {
      if(_registeredInWLM) // defect 241790, guard against attempting delete when not registered
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          SibTr.debug(tc, "Deregister MQLink: " + getUuid() + ", from LinkManager");       
        _linkManager.deregister(getUuid());
      }
      _registeredInWLM = false;
    }
    catch (LinkException e)
    {
      //Error during create of the link.  Trace an FFST.  If we cant 
      //advertise the link, other ME's wont be able to send to it
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.MQLinkHandler.deregisterDestination",
        "1:769:1.71",
        this);
  
      SibTr.exception(tc, e);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
        SibTr.exit(tc, "deregisterDestination", e);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deregisterDestination");  
      
    return;
  }
236286
protected final void unregisterConsumer( AbstractMessageConsumer consumerToRemove )
    {
        if (consumersMap.remove(consumerToRemove.getId()) == null)
            log.warn("Unknown consumer : "+consumerToRemove);
    }
220155
def delete_os_dummy_rtr(self, tenant_id, fw_dict, is_fw_virt=False):
        
        ret = True
        tenant_name = fw_dict.get('tenant_name')
        try:
            rtr_id = fw_dict.get('router_id')
            if not rtr_id:
                LOG.error("Invalid router id, deleting dummy interface"
                          " failed")
                return False
            if not is_fw_virt:
                ret = self._delete_dummy_intf_rtr(tenant_id, tenant_name,
                                                  rtr_id)
        except Exception as exc:
            # Function _attach_dummy_intf_rtr already took care of
            # cleanup for error cases.
            LOG.error("Deletion of Openstack Router failed tenant "
                      "%(tenant)s, Exception %(exc)s",
                      {'tenant': tenant_id, 'exc': str(exc)})
            ret = False
        if ret:
            res = fw_const.OS_DUMMY_RTR_DEL_SUCCESS
        else:
            res = fw_const.OS_DUMMY_RTR_DEL_FAIL
        self.update_fw_db_result(tenant_id, os_status=res)
        return ret
361130
def delete_os_dummy_rtr_nwk(self, rtr_id, net_id, subnet_id):
        
        subnet_lst = set()
        subnet_lst.add(subnet_id)
        ret = self.os_helper.delete_intf_router(None, None, rtr_id, subnet_lst)
        if not ret:
            return ret
        return self.os_helper.delete_network_all_subnets(net_id)
493957
@Override
    protected void deregister(ServiceInstance instance) {

        if (instance.getInstanceId().isPresent()) {
            DeregisterInstanceRequest deregisterInstanceRequest = new DeregisterInstanceRequest().withServiceId(route53AutoRegistrationConfiguration.getAwsServiceId())
                    .withInstanceId(instance.getInstanceId().get());
            getDiscoveryClient().deregisterInstance(deregisterInstanceRequest);
        }
    }
279828
public void discardOperation(final PathAddress address, int major, int minor, final String operationName) {
        registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, OperationTransformerRegistry.DISCARD);
    }
454640
protected void deregisterMBeans(WebModuleMetaDataImpl webModule) {
        String methodName = "deregisterMBeans";

        String debugName;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            debugName = webModule.getApplicationMetaData().getName() + " " + webModule.getName();                                
        } else {
            debugName = null;
        }

        
        WebMBeanRuntime mBeanRuntime = webMBeanRuntimeServiceRef.getService();
        if (mBeanRuntime == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: No MBean Runtime");
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: MBean Runtime");
            }
        }

        ServiceRegistration<?> webModuleReg = webModule.mBeanServiceReg;                    
        if (webModuleReg != null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: Deregister module [ " + webModuleReg + " ]");
            }
            webModule.mBeanServiceReg = null;
            // The preference would be to call ServiceRegistrationImpl.isUnregistered(), but that 
            // is not in the ServiceRegistration API. That still might not be good enough anyways, 
            // if the deregistration happened between the call to isUnregistered and the local unregister() call.
            if (mBeanRuntime != null) {
                try {
                    webModuleReg.unregister();
                } catch (IllegalStateException ise) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                       Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: Had already deregistered module [ " + webModuleReg + " ]");
                    }
                }
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                debugName = webModule.getApplicationMetaData().getName() + webModule.getName();                
                Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: No registration");
            }
        }

        Iterator<IServletConfig> servletConfigs = webModule.getConfiguration().getServletInfos();        
        while (servletConfigs.hasNext()) {
            IServletConfig servletConfig = servletConfigs.next();
            String servletName = servletConfig.getServletName();

            WebComponentMetaDataImpl wcmdi = (WebComponentMetaDataImpl) servletConfig.getMetaData();
            ServiceRegistration<?> servletReg = wcmdi.mBeanServiceReg;                                
            if (servletReg != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, methodName, "Servlet [ " + servletName  + " ]: Deregister [ " + servletReg + " ]");
                }
                wcmdi.mBeanServiceReg = null;
                // The preference would be to call ServiceRegistrationImpl.isUnregistered(), but that 
                // is not in the ServiceRegistration API. That still might not be good enough anyways, 
                // if the deregistration happened between the call to isUnregistered and the local unregister() call.
                if (mBeanRuntime != null) {
                    try {
                        servletReg.unregister();
                    } catch (IllegalStateException ise) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, methodName, "Servlet [ " + servletName + " ]: Had already deregistered [ " + servletReg + " ]");
                        }
                    }
                }
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, methodName, "Servlet [ " + servletName  + " ]: No registration");
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Web Module [ " + debugName + " ]: Completed deregistrations");
        }                
    }
599699
public void dereferenceControllable()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "dereferenceControllable");
    _remoteDurableName = null;
    _anycastInputHandler = null;
    _destinationHandler = null;
    _messageProcessor = null;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "dereferenceControllable");    
  }
1368340
public void discardOperation(final PathAddress address, ModelVersion version, final String operationName) {
        registerTransformer(address.iterator(), version, operationName, OperationTransformerRegistry.DISCARD);
    }
487390
private void deregisterServices() {
	Iterator<ServiceRegistration<?>> serviceIterator = serviceRegistrations.iterator();
	while (serviceIterator.hasNext()) {
	    ServiceRegistration<?> serviceReference = serviceIterator.next();
	    serviceReference.unregister();
	    serviceIterator.remove();
	}
    }
278527
public static boolean canStay(ReconfigurationProblem rp, VM vm) {
        Mapping m = rp.getSourceModel().getMapping();
        if (m.isRunning(vm)) {
            int curPos = rp.getNode(m.getVMLocation(vm));
            return rp.getVMAction(vm).getDSlice().getHoster().contains(curPos);
        }
        return false;
    }
968592
private static void stripTransportDetails(Metadata metadata) {
    metadata.discardAll(HTTP2_STATUS);
    metadata.discardAll(InternalStatus.CODE_KEY);
    metadata.discardAll(InternalStatus.MESSAGE_KEY);
  }
1128771
public void destroyDestination(Destination d)
	{
		// method invocation is idempotent
		synchronized (proxies) {
			final AggregatorProxy p = (AggregatorProxy) proxies.get(d.getAddress());
			if (p == null)
				return;
			if (p.getDestination() == d) {
				proxies.remove(d.getAddress());
				d.destroy();
			}
			else
				logger.warn("not owner of " + d.getAddress());
		}
	}
1347431
@Override
    public void registerDestination(boolean hasLocal,
                                    boolean isDeleted)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc,
                        "registerDestination",
                        new Object[] {
                                      Boolean.valueOf(hasLocal),
                                      Boolean.valueOf(isDeleted),
                                      this });
        // Dont register temporary destinations or system destinations.
        if (!_baseDestinationHandler.isTemporary() && !_baseDestinationHandler.isSystem())
        {
            if (_pToPLocalMsgsItemStream != null && !(_pToPLocalMsgsItemStream instanceof MQLinkMessageItemStream))
                _localisationManager.registerDestination();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "registerDestination");
    }
799297
@Override
    public void serverStopping() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "serverStopping");

        synchronized (_mpStartStopLock) {
            _isWASOpenForEBusiness = false;
        }

        // If the destination manager is null, then don't even attempt this.
        // There is a possibility that the destination manager instance is
        // corrupt.
        if (_destinationManager != null)
            _destinationManager.announceWASClosedForEBusiness();

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "serverStopping");
    }
116921
private void tryRemoveDeadAssignments(NodeTraversal t,
      ControlFlowGraph<Node> cfg,
      Map<String, Var> allVarsInFn) {
    Iterable<DiGraphNode<Node, Branch>> nodes = cfg.getDirectedGraphNodes();

    for (DiGraphNode<Node, Branch> cfgNode : nodes) {
      FlowState<LiveVariableLattice> state =
          cfgNode.getAnnotation();
      Node n = cfgNode.getValue();
      if (n == null) {
        continue;
      }
      switch (n.getToken()) {
        case IF:
        case WHILE:
        case DO:
          tryRemoveAssignment(t, NodeUtil.getConditionExpression(n), state, allVarsInFn);
          continue;
        case FOR:
        case FOR_IN:
        case FOR_OF:
        case FOR_AWAIT_OF:
          if (n.isVanillaFor()) {
            tryRemoveAssignment(t, NodeUtil.getConditionExpression(n), state, allVarsInFn);
          }
          continue;
        case SWITCH:
        case CASE:
        case RETURN:
          if (n.hasChildren()) {
            tryRemoveAssignment(t, n.getFirstChild(), state, allVarsInFn);
          }
          continue;
          // TODO(user): case VAR: Remove var a=1;a=2;.....
        default:
          break;
      }

      tryRemoveAssignment(t, n, state, allVarsInFn);
    }
  }
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;
  }