In my Spring Boot application I have declared a custom scope for some of my beans. I would like to avoid injecting these beans directly into Singleton beans and instead use a Provider
to get instances to these beans.
Is there a way to check this at application start and throw an exception when a Singleton bean uses one of the custom scope beans directly?
Would be great if someone could point me in the right direction.