Java Code Examples for org.springframework.beans.factory.support.RootBeanDefinition#getSource()
The following examples show how to use
org.springframework.beans.factory.support.RootBeanDefinition#getSource() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SentinelBeanPostProcessor.java From spring-cloud-alibaba with Apache License 2.0 | 6 votes |
@Override public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) { if (checkSentinelProtect(beanDefinition, beanType, beanName)) { SentinelRestTemplate sentinelRestTemplate; if (beanDefinition.getSource() instanceof StandardMethodMetadata) { sentinelRestTemplate = ((StandardMethodMetadata) beanDefinition .getSource()).getIntrospectedMethod() .getAnnotation(SentinelRestTemplate.class); } else { sentinelRestTemplate = beanDefinition.getResolvedFactoryMethod() .getAnnotation(SentinelRestTemplate.class); } // check class and method validation checkSentinelRestTemplate(sentinelRestTemplate, beanName); cache.put(beanName, sentinelRestTemplate); } }
Example 2
Source File: SentinelBeanPostProcessor.java From spring-cloud-alibaba with Apache License 2.0 | 4 votes |
private boolean checkMethodMetadataReadingVisitor(RootBeanDefinition beanDefinition) { return beanDefinition.getSource() instanceof MethodMetadata && ((MethodMetadata) beanDefinition.getSource()) .isAnnotated(SentinelRestTemplate.class.getName()); }