Package org.springframework.beans.factory.annotation

Examples of org.springframework.beans.factory.annotation.AnnotatedBeanDefinition


   * @see https://jira.spring.io/browse/SPR-11360
   */
  @Test
  public void generateBeanNameFromComposedControllerAnnotationWithStringValue() {
    BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
    AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(
      ComposedControllerAnnotationWithStringValue.class);
    String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
    assertEquals("restController", beanName);
  }
View Full Code Here


  public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
    ScopeMetadata metadata = new ScopeMetadata();
    metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
    if (definition instanceof AnnotatedBeanDefinition) {
      AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
      Set<String> annTypes = annDef.getMetadata().getAnnotationTypes();
      String found = null;
      for (String annType : annTypes) {
        Set<String> metaAnns = annDef.getMetadata().getMetaAnnotationTypes(annType);
        if (metaAnns.contains("javax.inject.Scope")) {
          if (found != null) {
            throw new IllegalStateException("Found ambiguous scope annotations on bean class [" +
                definition.getBeanClassName() + "]: " + found + ", " + annType);
          }
View Full Code Here


  public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
    ScopeMetadata metadata = new ScopeMetadata();
    if (definition instanceof AnnotatedBeanDefinition) {
      AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
      Map<String, Object> attributes =
          annDef.getMetadata().getAnnotationAttributes(this.scopeAnnotationType.getName());
      if (attributes != null) {
        metadata.setScopeName((String) attributes.get("value"));
        ScopedProxyMode proxyMode = (ScopedProxyMode) attributes.get("proxyMode");
        if (proxyMode == null || proxyMode == ScopedProxyMode.DEFAULT) {
          proxyMode = this.defaultProxyMode;
View Full Code Here

 

  public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
    ScopeMetadata metadata = new ScopeMetadata();
    if (definition instanceof AnnotatedBeanDefinition) {
      AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
      Map<String, Object> attributes =
          annDef.getMetadata().getAnnotationAttributes(this.scopeAnnotationType.getName());
      if (attributes != null) {
        metadata.setScopeName((String) attributes.get("value"));
      }
      if (!metadata.getScopeName().equals(BeanDefinition.SCOPE_SINGLETON)) {
        metadata.setScopedProxyMode(this.scopedProxyMode);
View Full Code Here

  protected ScopeMetadata resolveCdiScopes(BeanDefinition definition) {
    if (!(definition instanceof AnnotatedBeanDefinition))
      return null;

    AnnotatedBeanDefinition annotatedDefinition = (AnnotatedBeanDefinition) definition;
    AnnotationMetadata metadata = annotatedDefinition.getMetadata();
    ScopeMetadata scopeMetadata = null;

    if (metadata.isAnnotated(APPLICATION_SCOPED))
      scopeMetadata = createScopeMetadata("singleton");
    else if (metadata.isAnnotated(SESSION_SCOPED))
View Full Code Here

  @Override
  public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
    ScopeMetadata metadata = new ScopeMetadata();
    if (definition instanceof AnnotatedBeanDefinition) {
      AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition)definition;
      Set<String> annotationTypes = annDef.getMetadata().getAnnotationTypes();

      //
      String scopeName;
      if (annotationTypes.contains(Singleton.class.getName())) {
        scopeName = "singleton";
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.annotation.AnnotatedBeanDefinition

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.