code: public boolean cleanup(boolean flushStreams, boolean redriveDeletionThread)
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "cleanup",
            new Object[]{Boolean.valueOf(flushStreams), Boolean.valueOf(redriveDeletionThread)});
  
      boolean retvalue = false;
  
      // first check if already finishedCloseAndFlush, since this call can be redriven
      synchronized (streamTable)
      {
        if (finishedCloseAndFlush)
        {
          retvalue = true;
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "cleanup", Boolean.valueOf(retvalue));
          return retvalue;
        }
      }
  
      if (!flushStreams)
      {
        // Simply cleanup the non-persistent state. The persistent state will get cleaned up when
        // the caller deletes everything from the AOContainerItemStream
        close();
        retvalue = true;
      }
      else
      {
        // have to flush all the streams
        closeAndFlush(redriveDeletionThread);
        synchronized (streamTable)
        {
          retvalue = finishedCloseAndFlush;
        }
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "cleanup", Boolean.valueOf(retvalue));
      return retvalue;
    }
docs: Cleanup the state in this AnycastOutputHandler. Called when this localisation is being
  deleted.
  @param flushStreams If true, need to flush the streams, else do not need to flush all streams. The cleanup
  may be asynchronous in the former case.
  @param redriveDeletionThread If the cleanup is asynchronous, this class needs to do something when the cleanup
  terminates. If true, it will redrive the AsynchDeletionThread, else it will itself delete its container item
  stream.
  @return true, if finished cleaning up, else false (will redrive the AsynchDeletionThread when finishes cleaning
  up