code: public boolean cleanupDestination() throws SIRollbackException, SIConnectionLostException, SIIncorrectCallException, SIResourceException 
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "cleanupDestination");
    
      boolean cleanedUp;
  
      //Clean up any remote localisations, reallocate messages that are marked as guesses
      cleanedUp = super.cleanupLocalisations();
      //Ensure any cleanup does not occur at the same time the link is being used.
      synchronized(this)
      {        
        if (isToBeDeleted())
        {
          // Clean up any PubSub neighbours that were making use of 
          // the link
          
          messageProcessor.getProxyHandler().cleanupLinkNeighbour(_busName);
          
          // A link can have inbound target stream state without a localisation for
          // the messages to be put onto, as it routes the messages directly onto
          // other destinations in the bus.  Until all the inbound streams are flushed,
          // the link cannot be deleted.
          PtoPInputHandler ptoPInputHandler = (PtoPInputHandler) getInputHandler(ProtocolType.UNICASTINPUT, null, null);
          TargetStreamManager targetStreamManager = ptoPInputHandler.getTargetStreamManager();
          
          if (targetStreamManager.isEmpty())
          {
            cleanedUp = super.cleanupDestination();
          }
        }
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "cleanupDestination", new Boolean(cleanedUp));
  
      return cleanedUp;
    }
docs: <p>Ensure all stream state associated with the link has been removed, then
  the linkHandler itself can be removed.</p>