Ensure single instance of a spring managed bean
问题 I have created a spring aspect to handle Retry mechanism. I have also created a Retry annotation. Following is the code for Retry annotation and an aspect which processes this annotation. @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Retry { /** * List of exceptions for which we need to retry method invocation. * * @return Array of classes. */ Class<?>[] exceptions(); /** * Number of retries. Default is 3. * * @return Number of retires. */ int retries()