Delete temporary destinations.
@param destination
978270
private void deleteTemporaryDestination(Destination destination) {
        log.debug("Delete temporary destination: '{}'", destination);

        try {
            if (destination instanceof TemporaryQueue) {
                ((TemporaryQueue) destination).delete();
            } else if (destination instanceof TemporaryTopic) {
                ((TemporaryTopic) destination).delete();
            }
        } catch (JMSException e) {
            log.error("Error while deleting temporary destination '" + destination + "'", e);
        }
    }
822763
public void removeFromMoving(InetAddress endpoint)
    {
        assert endpoint != null;

        lock.writeLock().lock();
        try
        {
            for (Pair<Token, InetAddress> pair : movingEndpoints)
            {
                if (pair.right.equals(endpoint))
                {
                    movingEndpoints.remove(pair);
                    break;
                }
            }

            invalidateCachedRings();
        }
        finally
        {
            lock.writeLock().unlock();
        }
    }
615350
public void moveResource(String source, String destination) {

        CmsLock lock = OpenCms.getMemoryMonitor().getCachedLock(source);
        if (lock != null) {
            OpenCms.getMemoryMonitor().uncacheLock(lock.getResourceName());
            CmsLock newLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType());
            lock = lock.getRelatedLock();
            if ((lock != null) && !lock.isNullLock()) {
                CmsLock relatedLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType());
                newLock.setRelatedLock(relatedLock);
            }
            OpenCms.getMemoryMonitor().cacheLock(newLock);
        }
    }
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;
  }
1116975
public void truncate(long newTruncationPoint) {
        if (newTruncationPoint < getFirstDrId()) {
            return;
        }
        final Iterator<Range<Long>> iter = m_map.asRanges().iterator();
        while (iter.hasNext()) {
            final Range<Long> next = iter.next();
            if (end(next) < newTruncationPoint) {
                iter.remove();
            } else if (next.contains(newTruncationPoint)) {
                iter.remove();
                m_map.add(range(newTruncationPoint, end(next)));
                return;
            } else {
                break;
            }
        }
        m_map.add(range(newTruncationPoint, newTruncationPoint));
    }
911492
public void removeAllDispatchablesForTransaction(int clientId) {
        if (tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeAllDispatchablesForTransaction", clientId);

        idToFirstLevelEntryMap.remove(clientId);

        if (tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeAllDispatchablesForTransaction");
    }
388678
private synchronized void removeExpiredEntriesSynced(long pTime) {
        if (pTime > nextExpiryTime) {
            ////
            long next = Long.MAX_VALUE;
            nextExpiryTime = next; // Avoid multiple runs...
            for (Iterator<Entry<K, V>> iterator = new EntryIterator(); iterator.hasNext();) {
                TimedEntry<K, V> entry = (TimedEntry<K, V>) iterator.next();
                ////
                long expires = entry.expires();
                if (expires < next) {
                    next = expires;
                }
                ////
            }
            ////
            nextExpiryTime = next;
        }
    }
1135629
public void deleteTargettingAliases()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deleteTargettingAliases");

    //Delete any aliases that target this destination
    if (aliasesThatTargetThisDest != null)
    {
      DynamicConfigManager dcm = messageProcessor.getDynamicConfigManager();
      
      synchronized(aliasesThatTargetThisDest)
      {
        Iterator i = aliasesThatTargetThisDest.iterator();
        while (i.hasNext())
        {
          AbstractAliasDestinationHandler abstractAliasDestinationHandler = 
            (AbstractAliasDestinationHandler) i.next();
          abstractAliasDestinationHandler.deleteTargettingAliases();
          
          //Delete the alias/foreign destination
          dcm.deleteAbstractAliasDestinationHandler(abstractAliasDestinationHandler);
          
          i.remove();
        }
      }
    }
    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deleteTargettingAliases");

    return;
  }
11024
public Bus<M> addDestination(Destination<M> destination) {
		if(destination != null) {
			logger.info("adding destination '{}' of class '{}'", destination.getId(), destination.getClass().getSimpleName());
			destinations.add(destination);
		}
		return this;
	}
314944
public void deleteSystemDestination(JsDestinationAddress destAddr) throws SIResourceException, SINotPossibleInCurrentConfigurationException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteSystemDestination", new Object[] { destAddr });

        BaseDestinationHandler destinationHandler = null;

        DestinationTypeFilter filter = new DestinationTypeFilter();
        filter.VISIBLE = Boolean.TRUE;
        filter.ALIAS = Boolean.FALSE;
        filter.FOREIGN_DESTINATION = Boolean.FALSE;
        DestinationHandler dh =
                        destinationIndex.findByName(destAddr.getDestinationName(), messageProcessor.getMessagingEngineBus(), filter);

        try
        {
            checkDestinationHandlerExists(
                                          dh != null,
                                          destAddr.getDestinationName(),
                                          messageProcessor.getMessagingEngineName());
        } catch (SITemporaryDestinationNotFoundException e)
        {
            // // FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.DestinationManager.deleteSystemDestination",
                                        "1:5408:1.508.1.7",
                                        this);

            // This shouldn't occur as the Connection will create a valid system destination.
            // Or validate that the destination address passed in is a system destination

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

            throw new SIErrorException(
                            nls.getFormattedMessage(
                                                    "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                    new Object[] { "com.ibm.ws.sib.processor.impl.DestinationManager",
                                                                  "1:5421:1.508.1.7",
                                                                  e,
                                                                  destAddr.getDestinationName() },
                                                    null),
                            e);
        }

        destinationHandler = (BaseDestinationHandler) dh;

        deleteSystemDestination(destinationHandler);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteSystemDestination");
    }
1248406
public void remove(IConverter converter, Object sourceObject,
			TypeReference<?> destinationType) {
		convertedObjects.remove(new ConvertedObjectsKey(converter,
				sourceObject, destinationType));
	}
51531
public static void serializeTo( Destination destination , RawDataBuffer out )
    {
    	try
    	{
    		if (destination == null)
    		{
    			out.writeByte(NO_DESTINATION);
    		}
    		else
	        if (destination instanceof Queue)
	        {
	            out.writeByte(TYPE_QUEUE);
	            out.writeUTF(((Queue)destination).getQueueName());
	        }
	        else
            if (destination instanceof Topic)
            {
            	out.writeByte(TYPE_TOPIC);
                out.writeUTF(((Topic)destination).getTopicName());
            }
            else
                throw new IllegalArgumentException("Unsupported destination : "+destination);
    	}
    	catch (JMSException e)
    	{
    		throw new IllegalArgumentException("Cannot serialize destination : "+e.getMessage());
    	}
    }
157821
@Override
    public final void clearProperties() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "clearProperties");

        if (mayHaveJmsUserProperties()) {
            getJmsUserPropertyMap().clear();
        }
        if (mayHaveMappedJmsSystemProperties()) {
            getJmsSystemPropertyMap().clear();
        }
        clearSmokeAndMirrorsProperties();
        if (hasMQMDPropertiesSet()) {
            getMQMDSetPropertiesMap().clear();
        }

        // Clear the super-classes cached lengths, but NOT anything pertaining to the payload
        super.clearCachedLengths();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "clearProperties");
    }
303767
protected void deleteTempDirectory (final File tempDirectory)
  {
    try
    {
      FileUtils.deleteDirectory (tempDirectory);
    }
    catch (final IOException e)
    {
      getLog ().warn ("Failed to delete temporary directory: " + tempDirectory, e);
    }
  }
263919
@Override
    public void removeMapping(int pos) {
        for (int i = pos; i < mappingCount - 1; i++) {
            map[i] = map[i + 1];
        }
        map[mappingCount - 1] = null;
        mappingCount--;
        notifyChanged();
    }
1251857
@Override
    public void deleteSystemDestination(JsDestinationAddress destAddress)
                    throws SINotPossibleInCurrentConfigurationException,
                    SIException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteSystemDestination", destAddress);

        // See if this connection has been closed
        checkNotClosed();

        if (!destAddress.getDestinationName().startsWith(SIMPConstants.SYSTEM_DESTINATION_PREFIX))
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "deleteSystemDestination", "SIIncorrectCallException");
            throw new SIIncorrectCallException(
                            nls.getFormattedMessage(
                                                    "SYSTEM_DESTINATION_USAGE_ERROR_CWSIP0024",
                                                    new Object[] { destAddress.getDestinationName(),
                                                                  _messageProcessor.getMessagingEngineName() },
                                                    null));
        }

        _destinationManager.deleteSystemDestination(destAddress);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteSystemDestination");
    }
1201297
public static void removeEntries(final File zip, final String[] paths) {
    operateInPlace(zip, new InPlaceAction() {
      public boolean act(File tmpFile) {
        removeEntries(zip, paths, tmpFile);
        return true;
      }
    });
  }