Refactoring of ancient autowired components

Question: we have some old code that dates back to times when we used Spring but before SpringVaadin… possibly even before we started using Vaadin at all. The pattern that we used is bad enough by itself but somewhere along the line between Vaadin 10 and 23, the performance implications of using it has become severe so it is fairly urgent to get rid of it altogether and I’m looking for suggestions.
The awful pattern:

// static autowire service
public class ContextProvider implements ApplicationContextAware {
  public static void autowire(Object object) {
    beanFactory.autowireBeanProperties(object, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);
  }
}
// example client code
public class MyCustomizedDialog extends Dialog {
  @Autowired
  private ImportantService importantService;
  public MyCustomizedDialog() {
    ContextProvider.autowire(this);
  }
  // ...
}

Yes, this results in autowiring instance variables at the wrong time, which is why it is non-trivial to just fix it correctly.

Awfulness aside, it appears to me that the beanFactory that is getting provided by ApplicationContextAware doesn’t share a cache with the beanFactory that is normally used to wire my components, so the first time one of these objects is wired we’re essentially regenerating most of the application’s beans.

Is there a way that I could get ahold of the right Vaadin scoped bean factory to use instead?

You could replace this with kind of a factory jtaf4/src/main/java/ch/jtaf/context/ApplicationContextHolder.java at develop · 72services/jtaf4 · GitHub

So no autowiring but a method to get a bean