code: @Override
      public void destroy() {
  
          /**
           * call @PreDestroy for POJO resource & provider(default constructor)
           */
          Set<ProviderResourceInfo> singletonProviderAndPathInfos = endpointInfo.getSingletonProviderAndPathInfos();
          for (ProviderResourceInfo o : singletonProviderAndPathInfos) {
  
              if (o.getRuntimeType() == RuntimeType.POJO) {
                  Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(o.getProviderResourceClass());
                  InjectionUtils.invokeLifeCycleMethod(o.getObject(), preDestoryMethod);
              }
  
          }
  
          /**
           * call @PreDestroy for provider(param constructor)
           */
          Set<ProviderResourceInfo> perRequestProviderAndPathInfos = endpointInfo.getPerRequestProviderAndPathInfos();
          for (ProviderResourceInfo o : perRequestProviderAndPathInfos) {
  
              if (o.getRuntimeType() == RuntimeType.POJO && o.isJaxRsProvider() == true) {
                  Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(o.getProviderResourceClass());
                  InjectionUtils.invokeLifeCycleMethod(o.getObject(), preDestoryMethod);
              }
  
          }
  
          //call preDestroy method for non-customized Applications
          if (!endpointInfo.isCustomizedApp()) {
              Application app = endpointInfo.getApp();
              Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(app.getClass());
              InjectionUtils.invokeLifeCycleMethod(app, preDestoryMethod);
  
          } else {
  
              for (JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
                  beanCustomizer.destroyApplicationScopeResources(jaxRsModuleMetaData);
              }
          }
  
          if (server != null) {
              server.destroy();
          }
          if (features != null) {
              features.clear();
          }
      }
docs: {@inheritDoc}