Package org.springframework.context.annotation

Examples of org.springframework.context.annotation.ScopeMetadata


     *
     * @param beanDef the component bean definition to resolve
     * @return the scope meta data for the given bean definition.
     */
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDef) {
        ScopeMetadata sm = new ScopeMetadata();

        try {
            Class beanClass = ClickUtils.classForName(beanDef.getBeanClassName());

            if (Page.class.isAssignableFrom(beanClass)) {
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_PROTOTYPE);

            } else {
                // TODO: see whether we can determine the default scope definition
                // from the beanDef and return this instead.
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_SINGLETON);
            }

            return sm;

        } catch (Exception e) {
View Full Code Here


    String name = beanNameGenerator.generateBeanName(definition, registry);
    BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(definition, name);

    VRaptorScopeResolver scopeResolver = new VRaptorScopeResolver();
    ScopeMetadata scopeMetadata = scopeResolver.resolveScopeMetadata(definition);
    definitionHolder = applyScopeOn(registry, definitionHolder, scopeMetadata);

    BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry);
  }
View Full Code Here

     *
     * @param beanDef the component bean definition to resolve
     * @return the scope meta data for the given bean definition.
     */
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDef) {
        ScopeMetadata sm = new ScopeMetadata();

        try {
            Class beanClass = ClickUtils.classForName(beanDef.getBeanClassName());

            if (Page.class.isAssignableFrom(beanClass)) {
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_PROTOTYPE);

            } else {
                // TODO: see whether we can determine the default scope definition
                // from the beanDef and return this instead.
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_SINGLETON);
            }

            return sm;

        } catch (Exception e) {
View Full Code Here

    String name = beanNameGenerator.generateBeanName(definition, registry);
    BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(definition, name);

    VRaptorScopeResolver scopeResolver = new VRaptorScopeResolver();
    ScopeMetadata scopeMetadata = scopeResolver.resolveScopeMetadata(definition);
    definitionHolder = applyScopeOn(registry, definitionHolder, scopeMetadata);

    BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry);
  }
View Full Code Here

     * {@inheritDoc}
     *
     * @see org.springframework.context.annotation.ScopeMetadataResolver#resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition)
     */
    public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
        ScopeMetadata scopeMetadata = new ScopeMetadata();
        scopeMetadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
        return scopeMetadata;
    }
View Full Code Here

     * {@inheritDoc}
     *
     * @see org.springframework.context.annotation.ScopeMetadataResolver#resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition)
     */
    public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
        ScopeMetadata scopeMetadata = new ScopeMetadata();
        scopeMetadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
        return scopeMetadata;
    }
View Full Code Here

     *
     * @param beanDef the component bean definition to resolve
     * @return the scope meta data for the given bean definition.
     */
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDef) {
        ScopeMetadata sm = new ScopeMetadata();

        try {
            Class beanClass = ClickUtils.classForName(beanDef.getBeanClassName());

            if (Page.class.isAssignableFrom(beanClass)) {
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_PROTOTYPE);

            } else {
                sm.setScopeName(ConfigurableBeanFactory.SCOPE_SINGLETON);
            }

            return sm;

        } catch (Exception e) {
View Full Code Here

  public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
  AnnotationMetadata metadata = ((AnnotatedBeanDefinition) definition).getMetadata();
  for (Map.Entry<String, String> scope : scopes.entrySet()) {
    if (metadata.hasAnnotation(scope.getKey())) {
    ScopeMetadata scopeMetadata = new ScopeMetadata();
    scopeMetadata.setScopeName(scope.getValue());
    return scopeMetadata;
    }
  }
  return requestScopeAsDefault();
  }
View Full Code Here

  }
  return requestScopeAsDefault();
  }

  private ScopeMetadata requestScopeAsDefault() {
  ScopeMetadata singleton = new ScopeMetadata();
  singleton.setScopeName(WebApplicationContext.SCOPE_REQUEST);
  return singleton;
  }
View Full Code Here

    }

    String name = beanNameGenerator.generateBeanName(definition, (BeanDefinitionRegistry) beanFactory);
    BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(definition, name);

    ScopeMetadata scopeMetadata = scopeResolver.resolveScopeMetadata(definition);
    definitionHolder = applyScopeOn(definitionHolder, scopeMetadata);

    BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, (BeanDefinitionRegistry) beanFactory);
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.annotation.ScopeMetadata

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.