code: @Override
      public synchronized ChainGroupData[] getAllChainGroups(String chainName) throws ChainException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "getAllChainGroups chainName=" + chainName);
          }
          if (null == chainName) {
              throw new InvalidChainNameException("Null chain name");
          }
  
          // Ensure the chain exists.
          ChainData chain = this.chainDataMap.get(chainName);
          if (null == chain) {
              throw new ChainException("Unable to find chain: " + chainName);
          }
  
          int index = 0;
          int numGroups = getNumGroupsUsingChain(chainName);
          ChainGroupData[] groupArray = new ChainGroupData[numGroups];
          for (ChainGroupData group : this.chainGroups.values()) {
              if (group.containsChain(chainName)) {
                  groupArray[index++] = group;
              }
          }
          return groupArray;
      }
docs: /*
  @see
  com.ibm.wsspi.channelfw.ChannelFramework#getAllChainGroups(java.lang.String
  )