code: protected void destroyConnectionFactories(boolean destroyImmediately) {
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "destroyConnectionFactories", destroyImmediately, destroyWasDeferred);
  
          // Notify the application recycle coordinator of an incompatible config update that requires restarting the application
          if (!appsToRecycle.isEmpty()) {
              if (trace && tc.isDebugEnabled())
                  Tr.debug(this, tc, "recycle applications", appsToRecycle);
              
              ApplicationRecycleCoordinator appRecycleCoord = null;
              appRecycleCoord = (ApplicationRecycleCoordinator) priv.locateService(componentContext,"appRecycleService");
              
              Set<String> members = new HashSet<String>(appsToRecycle);
              appsToRecycle.removeAll(members);
              appRecycleCoord.recycleApplications(members);
          }
  
          lock.writeLock().lock();
          try {
              if (isInitialized.get() || destroyImmediately && destroyWasDeferred)
                  try {
                      // Mark all traditional WAS data source wrappers as disabled
                      isInitialized.set(false);
  
                      if (destroyImmediately) {
                          // Destroy the data source (it will only exist if it was looked up)
                          conMgrSvc.destroyConnectionFactories();
  
                          if (isDerbyEmbedded)
                              shutdownDerbyEmbedded();
  
                          conMgrSvc.deleteObserver(this);
                          jdbcDriverSvc.deleteObserver(this);
                      }
  
                      destroyWasDeferred = !destroyImmediately;
                  } catch (RuntimeException x) {
                      throw x;
                  } catch (Exception x) {
                      throw new RuntimeException(x);
                  }
          } finally {
              lock.writeLock().unlock();
          }
  
          if (trace && tc.isEntryEnabled())
              Tr.exit(this, tc, "destroyConnectionFactories");
      }
docs: Utility method to destroy WAS data source instances.
  
  @param destroyImmediately indicates to immediately destroy instead of deferring to later.