Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.RuntimeBeanReference


  private void registerFlushingAdvisor(BeanDefinitionRegistry registry) {
    Class flushingAdvisorClass = FlushingAttributeSourceAdvisor.class;
    RootBeanDefinition flushingAdvisor = new RootBeanDefinition(
        flushingAdvisorClass);
    flushingAdvisor.getConstructorArgumentValues().addGenericArgumentValue(
        new RuntimeBeanReference(BeanName.FLUSHING_INTERCEPTOR));
    registry.registerBeanDefinition(flushingAdvisorClass.getName(),
        flushingAdvisor);
  }
View Full Code Here


        .getBeanDefinition(beanName);

    ConfigAssert.assertBeanDefinitionWrapsClass(definition, targetClass);

    PropertyValue expected = new PropertyValue("flushingAttributeSource",
        new RuntimeBeanReference(beanName));

    ConfigAssert.assertPropertyIsPresent(propertyValues, expected);
  }
View Full Code Here

        int modelCount = 2;

        elementBuilder.setDefaultCachingListenerElementBuilders( listenerCount );

        // expectations for cache key generator.
        RuntimeBeanReference cacheKeyGenerator = expectCacheKeyGeneratorParsing();

        // expectations for parsing caching listeners.
        List cachingListeners = new ArrayList();
        for ( int i = 0; i < listenerCount; i++ )
        {
            String refId = elementBuilder.cachingListenerElementBuilders[i].refId;
            registry.registerBeanDefinition( refId, new RootBeanDefinition( CachingListener.class ) );

            Element cachingListenerElement = elementBuilder.cachingListenerElementBuilders[i].toXml();

            // parse caching listener element
            beanReferenceParser.parse( cachingListenerElement, parserContext, true );
            RuntimeBeanReference cachingListenerReference = new RuntimeBeanReference( refId );
            beanReferenceParserControl.setReturnValue( cachingListenerReference );

            // validate the caching listener
            validator.validate( cachingListenerReference, i, parserContext );

            cachingListeners.add( cachingListenerReference );
        }

        registerCacheProviderFacadeDefinition();

        // expectations for parsing cache models.
        elementBuilder.setDefaultCachingModelElementBuilders( modelCount );
        elementBuilder.setDefaultFlushingModelElementBuilders( modelCount );
        Map cachingModelMap = expectCachingModelParsing();
        Map flushingModelMap = expectFlushingModelParsing();

        Element element = elementBuilder.toXml();
        CacheSetupStrategyPropertySource propertySource =
            new CacheSetupStrategyPropertySource( cacheKeyGenerator,
                                                  new RuntimeBeanReference( elementBuilder.cacheProviderId ),
                                                  cachingListeners, cachingModelMap, flushingModelMap );

        strategyParser.parseCacheSetupStrategy( element, parserContext, propertySource );
        strategyParserControl.setMatcher( new CacheSetupStrategyPropertySourceMatcher() );
View Full Code Here

        Map cachingModelMap = expectCachingModelParsing();
        Map flushingModelMap = expectFlushingModelParsing();

        Element element = elementBuilder.toXml();
        CacheSetupStrategyPropertySource propertySource =
            new CacheSetupStrategyPropertySource( null, new RuntimeBeanReference( elementBuilder.cacheProviderId ),
                                                  null, cachingModelMap, flushingModelMap );

        strategyParser.parseCacheSetupStrategy( element, parserContext, propertySource );
        strategyParserControl.setMatcher( new CacheSetupStrategyPropertySourceMatcher() );
View Full Code Here

        Map flushingModelMap = expectFlushingModelParsing();

        Element element = elementBuilder.toXml();
        CacheSetupStrategyPropertySource propertySource =
            new CacheSetupStrategyPropertySource( null, new RuntimeBeanReference( elementBuilder.cacheProviderId ),
                                                  null, null, flushingModelMap );

        strategyParser.parseCacheSetupStrategy( element, parserContext, propertySource );
        strategyParserControl.setMatcher( new CacheSetupStrategyPropertySourceMatcher() );
View Full Code Here

        Map cachingModelMap = expectCachingModelParsing();

        Element element = elementBuilder.toXml();
        CacheSetupStrategyPropertySource propertySource =
            new CacheSetupStrategyPropertySource( null, new RuntimeBeanReference( elementBuilder.cacheProviderId ),
                                                  null, cachingModelMap, null );

        strategyParser.parseCacheSetupStrategy( element, parserContext, propertySource );
        strategyParserControl.setMatcher( new CacheSetupStrategyPropertySourceMatcher() );
View Full Code Here

    private RuntimeBeanReference expectCacheKeyGeneratorParsing()
    {
        CacheKeyGeneratorElementBuilder builder = new CacheKeyGeneratorElementBuilder();
        elementBuilder.cacheKeyGeneratorElementBuilder = builder;

        RuntimeBeanReference cacheKeyGenerator = new RuntimeBeanReference( "cacheKeyGenerator" );

        beanReferenceParser.parse( builder.toXml(), parserContext );
        beanReferenceParserControl.setReturnValue( cacheKeyGenerator );

        return cacheKeyGenerator;
View Full Code Here

  public void testValidateWithRuntimeBeanReference() {
    BeanDefinition beanDefinition = createCachingListenerBeanDefinition();
    String beanName = CACHING_LISTENER_BEAN_NAME;
    registry.registerBeanDefinition(beanName, beanDefinition);
    RuntimeBeanReference reference = new RuntimeBeanReference(beanName);

    validator.validate(reference, 0, parserContext);
  }
View Full Code Here

    registry.registerBeanDefinition(beanName, new RootBeanDefinition(
        AnnotationCachingAttributeSource.class));

    propertyValues.addPropertyValue("cachingAttributeSource",
        new RuntimeBeanReference(beanName));
  }
View Full Code Here

    registry.registerBeanDefinition(beanName, new RootBeanDefinition(
        AnnotationFlushingAttributeSource.class));

    propertyValues.addPropertyValue("flushingAttributeSource",
        new RuntimeBeanReference(beanName));
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.RuntimeBeanReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.