Code example for SimpleBeanDefinitionRegistry

0
 
    /** 
     * In order to resolve bean name from class using beanNameGenerator we 
     * need a registry - serves no other purpose. 
     */ 
    private final SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
 
    @Override 
    protected Class<? extends Annotation> annotationClass() {
        return SpringPlugin.class; 
    } 
 
    @Override 
    protected Function createFunction(String functionName, Method method) {
        AnnotatedGenericBeanDefinition beanDefinition = new AnnotatedGenericBeanDefinition(method.getDeclaringClass());
        String beanName = beanNameGenerator.generateBeanName(beanDefinition, registry);
 
        SpringFunction springFunction = new SpringFunction(functionName, FUNCTION_TYPE, beanName, method);
 
        return springFunction;