code: void threadFactoryDestroyed(String threadFactoryName, ThreadGroup parentGroup) {
          Collection<ThreadGroup> groupsToDestroy = new LinkedList<ThreadGroup>();
          for (ConcurrentHashMap<String, ThreadGroup> threadFactoryToThreadGroup : metadataIdentifierToThreadGroups.values()) {
              ThreadGroup group = threadFactoryToThreadGroup.remove(threadFactoryName);
              if (group != null)
                  groupsToDestroy.add(group);
          }
          groupsToDestroy.add(parentGroup);
          AccessController.doPrivileged(new InterruptAndDestroyThreadGroups(groupsToDestroy, deferrableScheduledExecutor), serverAccessControlContext);
      }
docs: Invoke this method when destroying a ManagedThreadFactory in order to interrupt all managed threads
  that it created.
  
  @param threadFactoryName unique identifier for the managed thread factory.