This is called by the location director when we are leaving this place and need to clean up
after ourselves and shutdown. Derived classes should override this method (being sure to
call <code>super.didLeavePlace</code>) and perform any necessary cleanup.
185860
public void didLeavePlace (final PlaceObject plobj)
    {
        // let our delegates know what's up
        applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
            @Override
            public void apply (PlaceControllerDelegate delegate) {
                delegate.didLeavePlace(plobj);
            }
        });

        // let the UI hierarchy know that we're outta here
        if (_view != null) {
            PlaceViewUtil.dispatchDidLeavePlace(_view, plobj);
            _ctx.clearPlaceView(_view);
            _view = null;
        }

        _plobj = null;
    }
466969
@SuppressWarnings({ "rawtypes", "unchecked" })
    private void cleanupSessions(List<String> storeNamesToCleanUp) {

        logger.info("Performing cleanup");
        for(String store: storeNamesToCleanUp) {

            for(Node node: nodesToStream) {
                try {
                    SocketAndStreams sands = nodeIdStoreToSocketAndStreams.get(new Pair(store,
                                                                                        node.getId()));
                    close(sands.getSocket());
                    SocketDestination destination = nodeIdStoreToSocketRequest.get(new Pair(store,
                                                                                            node.getId()));
                    streamingSocketPool.checkin(destination, sands);
                } catch(Exception ioE) {
                    logger.error(ioE);
                }
            }

        }

        cleanedUp = true;

    }
1196661
private void _doLogicalClear() {
	    // Only use one orphan command per panel to avoid object creation.
	    if (orphanCommand == null) {
	        orphanCommand = new AttachDetachException.Command() {
    	        @Override
                public void execute(Widget w) {
    	            orphan(w);
    	        }
    	    };
	    }
	    try {
	        AttachDetachException.tryCommand(this, orphanCommand);
	    } finally {
	        children = new WidgetCollection(this);
	    }
	}
41374
@Override
    final public void cleanup() throws ResourceException {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "cleanup");
        }

        // Invalidate all of the sessions

        for (final Iterator iterator = _sessions.iterator(); iterator.hasNext();) {
            final Object object = iterator.next();
            if (object instanceof JmsJcaSessionImpl) {
                ((JmsJcaSessionImpl) object).invalidate();
            }
        }
        _sessions.clear();

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "cleanup");
        }

    }
789517
public void onDestroy() {
    stopNavigation();
    removeOffRouteListener(null);
    removeProgressChangeListener(null);
    removeMilestoneEventListener(null);
    removeNavigationEventListener(null);
    removeFasterRouteListener(null);
    removeRawLocationListener(null);
  }
546510
protected void cleanupAndDestroyAllFreeConnections() {
        // This method is called within a synchronize block
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "cleanupAndDestroyAllFreeConnections");
        }
        int mcWrapperListIndex = mcWrapperList.size() - 1;
        for (int i = mcWrapperListIndex; i >= 0; --i) {
            MCWrapper mcw = (MCWrapper) mcWrapperList.remove(i);
            mcw.setPoolState(0);
            pm.totalConnectionCount.decrementAndGet();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "Calling cleanup and destroy on MCWrapper " + mcw);
            }
            cleanupAndDestroyMCWrapper(mcw);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "cleanupAndDestroyAllFreeConnections");
        }
    }
186627
private void cleanup() {
        long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "cleanup");
        val toRemove = this.processors.values().stream()
                                      .map(this::closeIfNecessary)
                                      .filter(ProcessorCollection::isClosed)
                                      .map(ProcessorCollection::getId)
                                      .collect(Collectors.toList());
        toRemove.forEach(this.processors::remove);
        LoggerHelpers.traceLeave(log, this.traceObjectId, "cleanup", traceId, toRemove.size());
    }
109579
private void moveOldStructure() throws Exception
   {
      ExtendedSession session = (ExtendedSession)service.getStorageSession();
      try
      {
         if (session.itemExists(storagePathOld))
         {
            return;
         }
         else
         {
            session.move(service.getStoragePath(), storagePathOld, false);
            session.save();
         }
      }
      finally
      {
         session.logout();
      }
   }
515381
private void cleanup() { // d623593
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "cleanup");

        synchronized (ivRemoteAsyncResultReaper) {
            if (ivAddedToReaper) { // d690014
                // d690014.3 - The call to remove will remove the result from the
                // reaper and then call unexportObject itself.
                this.ivRemoteAsyncResultReaper.remove(this);
            } else {
                unexportObject();
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "cleanup");
    }
1304614
public static void cleanup ()
  {
    // Reinitialize singletons to the default values
    if (LocaleCache.isInstantiated ())
      LocaleCache.getInstance ().reinitialize ();
    if (CountryCache.isInstantiated ())
      CountryCache.getInstance ().reinitialize ();
    if (LanguageCache.isInstantiated ())
      LanguageCache.getInstance ().reinitialize ();
    if (SerializationConverterRegistry.isInstantiated ())
      SerializationConverterRegistry.getInstance ().reinitialize ();
    if (MimeTypeDeterminator.isInstantiated ())
      MimeTypeDeterminator.getInstance ().reinitialize ();
    if (ThirdPartyModuleRegistry.isInstantiated ())
      ThirdPartyModuleRegistry.getInstance ().reinitialize ();
    if (TypeConverterRegistry.isInstantiated ())
      TypeConverterRegistry.getInstance ().reinitialize ();
    if (URLProtocolRegistry.isInstantiated ())
      URLProtocolRegistry.getInstance ().reinitialize ();
    if (EqualsImplementationRegistry.isInstantiated ())
      EqualsImplementationRegistry.getInstance ().reinitialize ();
    if (HashCodeImplementationRegistry.isInstantiated ())
      HashCodeImplementationRegistry.getInstance ().reinitialize ();

    // Clear caches
    if (DefaultTextResolver.isInstantiated ())
      DefaultTextResolver.getInstance ().clearCache ();
    EnumHelper.clearCache ();
    ResourceBundleHelper.clearCache ();
    if (RegExCache.isInstantiated ())
      RegExCache.getInstance ().clearCache ();
    CollatorHelper.clearCache ();
    LocaleHelper.clearCache ();
    StatisticsManager.clearCache ();
    SystemProperties.clearWarnedPropertyNames ();
    if (ImageDataManager.isInstantiated ())
      ImageDataManager.getInstance ().clearCache ();

    // Clean this one last as it is used in equals and hashCode implementations!
    ClassHierarchyCache.clearCache ();
  }
1346957
public CompletableFuture<Void> leave() {
    if (!started)
      return CompletableFuture.completedFuture(null);

    if (closeFuture == null) {
      synchronized (this) {
        if (closeFuture == null) {
          closeFuture = new CompletableFuture<>();
          if (openFuture == null) {
            cluster().leave().whenComplete((leaveResult, leaveError) -> {
              shutdown().whenComplete((shutdownResult, shutdownError) -> {
                context.delete();
                closeFuture.complete(null);
              });
            });
          } else {
            openFuture.whenComplete((openResult, openError) -> {
              if (openError == null) {
                cluster().leave().whenComplete((leaveResult, leaveError) -> {
                  shutdown().whenComplete((shutdownResult, shutdownError) -> {
                    context.delete();
                    closeFuture.complete(null);
                  });
                });
              } else {
                closeFuture.complete(null);
              }
            });
          }
        }
      }
    }

    return closeFuture;
  }
477704
protected void bodyLeft (final int bodyOid)
    {
        log.debug("Body left", "where", where(), "oid", bodyOid);

        // if their occupant info hasn't been removed (which may be the case if they logged off
        // rather than left via a MoveTo request), we need to get it on out of here
        Integer key = Integer.valueOf(bodyOid);
        if (_plobj.occupantInfo.containsKey(key)) {
            _plobj.removeFromOccupantInfo(key);
        }

        // clear out their canonical (local) occupant info record
        OccupantInfo leaver = _occInfo.remove(bodyOid);

        // let our delegates know what's up
        applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
            @Override public void apply (PlaceManagerDelegate delegate) {
                delegate.bodyLeft(bodyOid);
            }
        });

        // if that leaves us with zero occupants, maybe do something
        if (shouldDeclareEmpty(leaver)) {
            placeBecameEmpty();
        }
    }
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");    
  }
998032
public boolean leavePlace ()
    {
        if (_pendingPlaceId != -1) {
            return false;
        }

        _lservice.leavePlace();
        didLeavePlace();

        // let our observers know that we're no longer in a location
        _observers.apply(_didChangeOp);

        return true;
    }
805656
def cleanup(self):
        
        if getattr(self._finalizer, "detach", None) and self._finalizer.detach():
            if os.path.exists(self.path):
                try:
                    rmtree(self.path)
                except OSError:
                    pass
                else:
                    self.path = None
497032
private void handleInPlaceActions(File result) throws IOException {
    if (isInPlace()) {
      // we operate in-place
      FileUtils.forceDelete(src);
      if (result.isFile()) {
        FileUtils.moveFile(result, src);
      }
      else {
        FileUtils.moveDirectory(result, src);
      }
    }
  }
1010846
protected void actionGoingToWarehouse()
    {
        if (checker.canCarry())
        {
            for (final ExtractorListener listener : listeners)
            {
                listener.notifyStartDropOff(resourceType, lastProgress);
            }
            speed = dropOffPerSecond / rate.getAsInt();
            state = ExtractorState.DROPOFF;
        }
    }