code: public void blockUnDeployManagedDeploymentsWhenNeeded(@Observes EventContext<UnDeployManagedDeployments> eventContext) {
          if (!extensionEnabled()) {
              eventContext.proceed();
          }
          else if (undeployDeployments) {
              undeployDeployments = false;
              debug("NOT Blocking UnDeployManagedDeployments event {0}", eventContext.getEvent().toString());
              eventContext.proceed();
          } else {
              // Do nothing with event.
              debug("Blocking UnDeployManagedDeployments event {0}", eventContext.getEvent().toString());
          }
      }
docs: Method ignoring UnDeployManagedDeployments events at runtime.
  
  Only at undeploy container we will undeploy all.
  
  @param eventContext Event to check