code: @Override
    public void unregisterXAResource(String uniqueName, XAResource xaResource) {
      Ehcache3XAResourceProducer xaResourceProducer = producers.get(uniqueName);
  
      if (xaResourceProducer != null) {
        boolean found = xaResourceProducer.removeXAResource(xaResource);
        if (!found) {
          throw new IllegalStateException("no XAResource " + xaResource + " found in XAResourceProducer with name " + uniqueName);
        }
        if (xaResourceProducer.isEmpty()) {
          xaResourceProducer.close();
          producers.remove(uniqueName);
        }
      } else {
        throw new IllegalStateException("no XAResourceProducer registered with name " + uniqueName);
      }
    }
docs: Unregister an XAResource of a cache from BTM.
  @param uniqueName the uniqueName of this XAResourceProducer, usually the cache's name
  @param xaResource the XAResource to be registered