docs: @Override
     public final void stop() {
        // Trying to stop() from FAILED is valid, but may not work
        boolean failed;
  
        synchronized (this) {
           try {
              while (state == ComponentStatus.STOPPING) {
                 wait();
              }
              if (!state.stopAllowed()) {
                 getLog().debugf("Ignoring call to stop() as current state is %s", state);
                 return;
              }
  
              failed = state == ComponentStatus.FAILED;
              state = ComponentStatus.STOPPING;
           } catch (InterruptedException e) {
              throw new CacheException("Interrupted waiting for the component registry to stop");
           }
        }
  
        preStop();
  
        try {
           internalStop();
  
           postStop();
        } catch (Throwable t) {
           if (failed) {
              getLog().failedToCallStopAfterFailure(t);
           } else {
              handleLifecycleTransitionFailure(t);
           }
        } finally {
           synchronized (this) {
              state = ComponentStatus.TERMINATED;
           }
        }
     }