docs: protected void reconstitute(final int startMode) throws MessageStoreException
      {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "reconstitute", new Integer(startMode));
  
          /*
           * Iterate through all contained BaseDestinationHandlers and take appropriate
           * actions.
           */
          NonLockingCursor cursor = newNonLockingItemStreamCursor(new ClassEqualsFilter(BaseDestinationHandler.class));
  
          AbstractItem item = null;
  
          // Don't do flush if we are asked to start in recovery mode
          if (((startMode & JsConstants.ME_START_FLUSH) == JsConstants.ME_START_FLUSH)
              && ((startMode & JsConstants.ME_START_RECOVERY) == 0))
          {
              // Log message to console saying we have started flush for this ME
              SibTr.info(
                         tc,
                         "FLUSH_REQUESTED_MESSAGE_CWSIP0780",
                         messageProcessor.getMessagingEngineName());
          }
  
          // We let a Message Store cursor error here fall right down to the
          // MessageProcessor to invoke a cold start, on the basis that a failure here
          // is in all probably terminal for any future Message Store operations.
          while (null != (item = cursor.next()))
          {
              final BaseDestinationHandler dh = (BaseDestinationHandler) item;
  
              /*
               * If the destination is corrupt we want to ignore it on all subsequent
               * restarts. Attempting a delete will require reconstituting some
               * sections of the destination to keep a transaction happy, which will
               * most probably run into the same trouble that provoked the corruption in
               * the first place.
               */
              if (dh.isToBeIgnored())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Ignoring old corrupt destination " + dh.getName());
              }
  
              /*
               * If the destination has been recovered but was actually temporary
               * (as can happen with STORE_MAYBE) then remove it now. Otherwise,
               * make the destination available for messages.
               */
              else if (dh.isTemporary())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Deleting temporary destination " + dh.getName());
  
                  // 174199.2.13
                  // Need to remove all the ItemStreams and ReferenceStreams under this
                  // temporary destination in order to delete it
                  try
                  {
                      dh.deleteDirtyTemporary(messageProcessor, durableSubscriptions);
                  } catch (SIException e)
                  {
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                  "1:788:1.508.1.7",
                                                  this);
  
                      /*
                       * 174199.2.13
                       * Not being able to delete a temporary destination probably indicates
                       * a serious health problem.
                       * However, we can try to carry on.
                       */
                      SibTr.exception(tc, e);
                      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                  new Object[] { "com.ibm.ws.sib.processor.impl.DestinationManager", "1:799:1.508.1.7", SIMPUtils.getStackTrace(e), dh.getName() });
                  }
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Deleted temporary destination " + dh.getName());
              }
              else
              {
                  try
                  {
                      // add all the tasks to the threadpool
                      startNewReconstituteThread(new Runnable()
                      {
                          @Override
                          public void run()
                          {
                              try
                              {
                                  // 174199.2.9
                                  dh.reconstitute(messageProcessor, durableSubscriptions, startMode);
                              }
                              //729873
                              catch (SIResourceException mse)
                              {
                                  FFDCFilter.processException(
                                                              mse,
                                                              "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                              "1:826:1.508.1.7", this);
                                  SibTr.error(tc, "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0051",
                                              new Object[] { dh.getName(), SIMPUtils.getStackTrace(mse) });
  
                                  SibTr.exception(tc, mse);
  
                                  if (mse.getCause() instanceof SevereMessageStoreException) {
  
                                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                                          SibTr.event(tc, "Datasource has thrown a severe error!", mse);
  
                                      messageProcessor.getMessageStore().reportLocalError();
                                  }
                              }
  
                              catch (Exception e)
                              {
                                  FFDCFilter.processException(
                                                              e,
                                                              "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                              "1:846:1.508.1.7",
                                                              this);
  
                                  // If the destination has been detected as corrupt for any reason,
                                  // we are
                                  // content just to isolate the destination and allow reconstitution
                                  // to carry on.
                                  // Log to console
                                  SibTr.error(
                                              tc,
                                              "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0051",
                                              new Object[] { dh.getName(), SIMPUtils.getStackTrace(e) });
  
                                  SibTr.exception(tc, e);
                              }
  
                              // Don't need to synchronize the add since no other thread should be
                              // interacting with the DestinationManager during reconstitution.
                              // 182637 - Currently, we are storing no information on whether the
                              // PtoPMessageItemStream was local or remote, or whether there was more than
                              // one.
                              DestinationIndex.Type type = new DestinationIndex.Type();
                              if (dh.isCorruptOrIndoubt())
                                  type.state = State.CORRUPT;
                              else if (dh.isSystem())
                              {
                                  // We need to add localisations for the system destinations here since they
                                  // will not reconcile because they are not in wccm.
                                  type.state = State.ACTIVE;
  
                                  SIBUuid8 parsedME = SIMPUtils.parseME(dh.getName());
  
                                  Set<String> queuePointLocalizingMEs = new HashSet<String>();
                                  queuePointLocalizingMEs.add(parsedME.toString());
  
                                  try
                                  {
                                      dh.updateLocalizationSet(queuePointLocalizingMEs);
                                  } catch (SIResourceException e)
                                  {
                                      FFDCFilter.processException(
                                                                  e,
                                                                  "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                                  "1:890:1.508.1.7",
                                                                  this);
  
                                      SibTr.exception(tc, e);
                                  }
  
                              }
                              else
                                  type.state = State.UNRECONCILED;
                              type.alias = new Boolean(dh.isAlias());
                              type.foreignDestination = new Boolean(dh.isForeign());
                              type.queue = new Boolean(!dh.isPubSub());
                              type.local = new Boolean(dh.hasLocal());
                              type.remote = new Boolean(dh.hasRemote());
                              destinationIndex.put(dh, type);
  
                              dh.registerControlAdapters();
  
                              Object[] uuids = dh.getPostReconstitutePseudoIds();
  
                              if (uuids != null)
                              {
                                  for (int i = 0; i < uuids.length; i++)
                                  {
                                      SIBUuid12 pseudoUuid = (SIBUuid12) uuids[i];
  
                                      destinationIndex.addPseudoUuid(dh, pseudoUuid);
                                  }
                              }
  
                          }//end of run()
                      });
                  } catch (InterruptedException e) {
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                  "1:926:1.508.1.7",
                                                  this);
                  }
              }
          }
  
          // Wait until the reconstitution of BaseDestinationHandler is completed
          if (_reconstituteThreadpool != null)
              waitUntilReconstitutionIsCompleted();
          cursor.finished();
  
          /*
           * Iterate through all contained LinkDestinationHandlers and take appropriate
           * actions.
           */
          cursor = newNonLockingItemStreamCursor(new ClassEqualsFilter(LinkHandler.class));
  
          item = null;
  
          // We let a Message Store cursor error here fall right down to the
          // MessageProcessor to invoke a cold start, on the basis that a failure here
          // is in all probably terminal for any future Message Store operations.
          while (null != (item = cursor.next()))
          {
  
              final LinkHandler linkHandler = (LinkHandler) item;
  
              /*
               * If the link is corrupt we want to ignore it on all subsequent
               * restarts. Attempting a delete will require reconstituting some
               * sections of the link to keep a transaction happy, which will
               * most probably run into the same trouble that provoked the corruption in
               * the first place.
               */
              if (linkHandler.isToBeIgnored())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Ignoring old corrupt link " + linkHandler.getName());
              }
              else
              {
                  try
                  {
                      // add all the tasks to the threadpool
                      startNewReconstituteThread(new Runnable()
                      {
                          @Override
                          public void run()
                          {
  
                              try
                              {
                                  linkHandler.reconstitute(messageProcessor,
                                                           durableSubscriptions, startMode);
                              } catch (Exception e) {
                                  FFDCFilter.processException(
                                                              e,
                                                              "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                              "1:984:1.508.1.7",
                                                              this);
  
                                  /*
                                   * Not being able to recover a link probably indicates
                                   * a serious health problem.
                                   * However, we will try to carry on. The data of the unrecoverable
                                   * link remains in the database for later recovery.
                                   */
                                  // Log to console
                                  SibTr.error(
                                              tc,
                                              "LINK_HANDLER_WARM_START_ERROR_CWSIP0056",
                                              new Object[] {
                                                            "com.ibm.ws.sib.processor.impl.DestinationManager",
                                                            "1:999:1.508.1.7", SIMPUtils.getStackTrace(e) });
  
                                  SibTr.exception(tc, e);
                              }
  
                              LinkIndex.Type type = new LinkIndex.Type();
                              if (linkHandler.isCorruptOrIndoubt())
                                  type.state = State.CORRUPT;
                              else if (linkHandler.isSystem())
                                  type.state = State.ACTIVE;
                              else
                                  type.state = State.UNRECONCILED;
                              type.mqLink = Boolean.FALSE;
                              type.local = new Boolean(linkHandler.hasLocal());
                              type.remote = new Boolean(!linkHandler.hasLocal());
                              linkIndex.put(linkHandler, type);
  
                              linkHandler.registerControlAdapters();
                          }// end of run()
                      });
                  } catch (InterruptedException e) {
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                  "1:1023:1.508.1.7",
                                                  this);
                  }
              }
          }
  
          // Wait until the reconstitution of LinkHandler is completed
          if (_reconstituteThreadpool != null)
              waitUntilReconstitutionIsCompleted();
          cursor.finished();
  
          /*
           * Iterate through all contained MQLinkDestinationHandlers and take appropriate
           * actions.
           */
          cursor = newNonLockingItemStreamCursor(new ClassEqualsFilter(MQLinkHandler.class));
  
          item = null;
  
          // We let a Message Store cursor error here fall right down to the
          // MessageProcessor to invoke a cold start, on the basis that a failure here
          // is in all probably terminal for any future Message Store operations.
          while (null != (item = cursor.next()))
          {
  
              final MQLinkHandler linkHandler = (MQLinkHandler) item;
  
              /*
               * If the link is corrupt we want to ignore it on all subsequent
               * restarts. Attempting a delete will require reconstituting some
               * sections of the link to keep a transaction happy, which will
               * most probably run into the same trouble that provoked the corruption in
               * the first place.
               */
              if (linkHandler.isToBeIgnored())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Ignoring old corrupt MQlink "
                                      + linkHandler.getName());
              }
              else
              {
                  try
                  {
                      // add all the tasks to the threadpool
                      startNewReconstituteThread(new Runnable()
                      {
                          @Override
                          public void run()
                          {
                              try
                              {
                                  linkHandler.reconstitute(messageProcessor, durableSubscriptions, startMode);
                              } catch (Exception e)
                              {
                                  FFDCFilter.processException(
                                                              e,
                                                              "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                              "1:1082:1.508.1.7",
                                                              this);
  
                                  /*
                                   * Not being able to recover a link probably indicates
                                   * a serious health problem.
                                   * However, we will try to carry on. The data of the unrecoverable
                                   * link remains in the database for later reset.
                                   */
                                  SibTr.error(
                                              tc,
                                              "LINK_HANDLER_WARM_START_ERROR_CWSIP0056",
                                              new Object[] { linkHandler.getName(),
                                                            linkHandler.getUuid(),
                                                            SIMPUtils.getStackTrace(e) });
  
                                  SibTr.exception(tc, e);
                              }
  
                              LinkIndex.Type type = new LinkIndex.Type();
                              if (linkHandler.isCorruptOrIndoubt())
                                  type.state = State.CORRUPT;
                              else if (linkHandler.isSystem())
                                  type.state = State.ACTIVE;
                              else
                                  type.state = State.UNRECONCILED;
                              type.mqLink = Boolean.TRUE;
                              type.local = Boolean.TRUE;
                              type.remote = Boolean.FALSE;
                              linkIndex.put(linkHandler, type);
  
                              linkHandler.registerControlAdapters();
                          }//end of run()
                      });
                  } catch (InterruptedException e) {
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.DestinationManager.reconstitute",
                                                  "1:1120:1.508.1.7",
                                                  this);
                  }
              }
          }
  
          // Wait until the reconstitution of MQLinkHandler is completed
          if (_reconstituteThreadpool != null)
              waitUntilReconstitutionIsCompleted();
          cursor.finished();
  
          // Don't do flush if we are asked to start in recovery mode
          if (((startMode & JsConstants.ME_START_FLUSH) == JsConstants.ME_START_FLUSH)
              && ((startMode & JsConstants.ME_START_RECOVERY) == 0))
          {
              // Log message to console saying we have finished flush for this ME
              SibTr.info(
                         tc,
                         "FLUSH_COMPLETED_MESSAGE_CWSIP0783",
                         messageProcessor.getMessagingEngineName());
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "reconstitute");
      }