code: public void removeExtension(Extension extension) {
          extensionList.remove(extension);
          extensionsMap.remove(extension.getClass());
  
          ExtensionHook hook = extensionHooks.remove(extension);
          if (hook == null) {
              logger.error("ExtensionHook not found for: " + extension.getClass().getCanonicalName());
              return;
          }
  
          unloadOptions(hook);
  
          unhookProxies(hook);
  
          removePersistentConnectionListener(hook);
  
          removeProxyListener(hook);
  
          removeOverrideMessageProxyListener(hook);
  
          removeConnectRequestProxyListener(hook);
  
          removeSiteMapListener(hook);
  
          for (ContextDataFactory contextDataFactory : hook.getContextDataFactories()) {
              try {
                  model.removeContextDataFactory(contextDataFactory);
              } catch (Exception e) {
                  logger.error("Error while removing a ContextDataFactory from " + extension.getClass().getCanonicalName(), e);
              }
          }
  
          for (ApiImplementor apiImplementor : hook.getApiImplementors()) {
              try {
                  API.getInstance().removeApiImplementor(apiImplementor);
              } catch (Exception e) {
                  logger.error("Error while removing an ApiImplementor from " + extension.getClass().getCanonicalName(), e);
              }
          }
  
          for (HttpSenderListener httpSenderListener : hook.getHttpSenderListeners()) {
              try {
                  HttpSender.removeListener(httpSenderListener);
              } catch (Exception e) {
                  logger.error("Error while removing an HttpSenderListener from " + extension.getClass().getCanonicalName(), e);
              }
          }
  
          removeViewInEDT(extension, hook);
      }
docs: Removes the given extension and any components added through its extension hook.
  <p>
  <strong>Note:</strong> This method should be called only by bootstrap classes.
  
  @param extension the extension to remove.
  @since TODO add version