code: public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
          for (Object handler : handlerInstances) {
              Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
              Scope scope = handlerAnnotation.scope();
  
              runLifecycleMethods(handler, scope, scopeEnding, true);
  
              //dispose handler instances with a scope which matches the scopeEnding
              if (scope == scopeEnding) {
                  disposeSpringResources(handler, scopeEnding);
              }
          }
      }
docs: Scope is ending, perform the required processing on the supplied handlers.