code: ThreadGroup getThreadGroup(String identifier, String threadFactoryName, ThreadGroup parentGroup) {
          ConcurrentHashMap<String, ThreadGroup> threadFactoryToThreadGroup = metadataIdentifierToThreadGroups.get(identifier);
          if (threadFactoryToThreadGroup == null)
              if (metadataIdentifierService.isMetaDataAvailable(identifier)) {
                  threadFactoryToThreadGroup = new ConcurrentHashMap<String, ThreadGroup>();
                  ConcurrentHashMap<String, ThreadGroup> added = metadataIdentifierToThreadGroups.putIfAbsent(identifier, threadFactoryToThreadGroup);
                  if (added != null)
                      threadFactoryToThreadGroup = added;
              } else
                  throw new IllegalStateException(identifier.toString());
  
          ThreadGroup group = threadFactoryToThreadGroup.get(threadFactoryName);
          if (group == null)
              group = AccessController.doPrivileged(new CreateThreadGroupIfAbsentAction(parentGroup, threadFactoryName, identifier, threadFactoryToThreadGroup),
                                                    serverAccessControlContext);
          return group;
      }
docs: Returns the thread group to use for the specified application component.
  
  @param jeeName name of the application component
  @param threadFactoryName unique identifier for the thread factory
  @param parentGroup parent thread group
  @return child thread group for the application component. Null if the application component isn't active.
  @throws IllegalStateException if the application component is not available.