docs: @Override
      public String[] invalidateCacheIDs(String cacheInstance, String pattern, boolean waitOnInvalidation) throws javax.management.AttributeNotFoundException {
  
          // Get the cache for this cacheInstance
          DCache cache1 = getCache(cacheInstance);
  
          //Check to see if request is to clear the cache
          if (pattern.equals("*")) {
              cache1.clear();
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "invalidateCacheIDs: Exiting. Cleared memory and disk cache since input pattern is *");
              return new String[] { "*" };
          }
  
          // Check that the input pattern is a valid regular expression
          Pattern cpattern = checkPattern(pattern);
  
          // Get union of matches in memory and on disk
          Collection<String> invalidateSet = new ArrayList<String>();
  
          // Call mbeans to get matches in memory and on disk.
          String[] memoryMatches = getCacheIDsInMemory(cacheInstance, pattern);
          if (null != memoryMatches) {
              for (int i = 0; i < memoryMatches.length; i++) {
                  invalidateSet.add(memoryMatches[i]);
              }
          }
          if (cache1.getSwapToDisk()) {
              String[] diskMatches = getCacheIDsOnDisk(cacheInstance, pattern);
              if (null != diskMatches) {
                  for (int i = 0; i < diskMatches.length; i++) {
                      invalidateSet.add(diskMatches[i]);
                  }
              }
          }
  
          Iterator invalidates = invalidateSet.iterator();
          // Invalidate the set of cache ids matched to the pattern and all
          // entries dependent on the matched entry
          while (invalidates.hasNext()) {
              Object cacheID = invalidates.next();
              cache1.invalidateById(cacheID, waitOnInvalidation);
          }
  
          if (tc.isDebugEnabled())
              Tr.debug(tc, "invalidateCacheIDs: Exiting. Number of matches found = " + invalidateSet.size());
  
          //need to convert to string array before return.
          //Allocate output array #entries matched 
          String[] cids = invalidateSet.toArray(new String[invalidateSet.size()]);
          return cids;
      }