code: @Override
      public void contextDestroyed(ServletContextEvent arg0) {
          if (endpointManager != null) {
              if (!FrameworkState.isStopping()) {
                  endpointManager.closeAllOpenSessions();
                  endpointManager.clear();
              }
              else {
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "Server is being shutdown, no need to stop stop clients");
                  }
              }
          }
  
      }
docs: /*
  (non-Javadoc)
  
  @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)