سؤال

At work we have a custom ServiceProvider pattern with an annotation for binding services with a spring post-processor.

I wonder if i can check if my binding was correctly done, by using @Required.

The binding is not done by Spring (neither xml or autowiring).

I guess if it's possible, the post processor order has some importance (spring checking required should be processed after our custom binding processor).

Can someone tell me if it's possible and how?

هل كانت مفيدة؟

المحلول

RequiredAnnotationBeanPostProcessor is a PriorityOrdered with order value Integer.MAX_VALUE - 1. Threrefore your postprocessor need to implement PriorityOrdered with the lesser order value to be fired before RequiredAnnotationBeanPostProcessor.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top