Package org.springframework.stereotype

Examples of org.springframework.stereotype.Component


        logger.trace("Using @ServerEndpoint singleton " + endpoint);
      }
      return endpoint;
    }

    Component annot = AnnotationUtils.findAnnotation(endpointClass, Component.class);
    if ((annot != null) && wac.containsBean(annot.value())) {
      T endpoint = wac.getBean(annot.value(), endpointClass);
      if (logger.isTraceEnabled()) {
        logger.trace("Using @ServerEndpoint singleton " + endpoint);
      }
      return endpoint;
    }
View Full Code Here


  /**
   * @since 4.1.2
   */
  @Test
  public void findAnnotationFavorsLocalMetaAnnotationsOverInterfaces() {
    Component component = AnnotationUtils.findAnnotation(
        ClassWithLocalMetaAnnotationAndMetaAnnotatedInterface.class, Component.class);
    assertNotNull(component);
    assertEquals("meta2", component.value());
  }
View Full Code Here

  /**
   * @since 4.0.3
   */
  @Test
  public void findAnnotationFavorsInheritedComposedAnnotationsOverMoreLocallyDeclaredComposedAnnotations() {
    Component component = AnnotationUtils.findAnnotation(
        SubSubClassWithInheritedMetaAnnotation.class, Component.class);
    assertNotNull(component);
    assertEquals("meta2", component.value());
  }
View Full Code Here

    assertEquals("meta2", component.value());
  }

  @Test
  public void findAnnotationOnMetaMetaAnnotatedClass() {
    Component component = AnnotationUtils.findAnnotation(MetaMetaAnnotatedClass.class, Component.class);
    assertNotNull("Should find meta-annotation on composed annotation on class", component);
    assertEquals("meta2", component.value());
  }
View Full Code Here

    assertEquals("meta2", component.value());
  }

  @Test
  public void findAnnotationOnMetaMetaMetaAnnotatedClass() {
    Component component = AnnotationUtils.findAnnotation(MetaMetaMetaAnnotatedClass.class, Component.class);
    assertNotNull("Should find meta-annotation on meta-annotation on composed annotation on class", component);
    assertEquals("meta2", component.value());
  }
View Full Code Here

  }

  @Test
  public void findAnnotationOnAnnotatedClassWithMissingTargetMetaAnnotation() {
    // TransactionalClass is NOT annotated or meta-annotated with @Component
    Component component = AnnotationUtils.findAnnotation(TransactionalClass.class, Component.class);
    assertNull("Should not find @Component on TransactionalClass", component);
  }
View Full Code Here

    assertNull("Should not find @Component on TransactionalClass", component);
  }

  @Test
  public void findAnnotationOnMetaCycleAnnotatedClassWithMissingTargetMetaAnnotation() {
    Component component = AnnotationUtils.findAnnotation(MetaCycleAnnotatedClass.class, Component.class);
    assertNull("Should not find @Component on MetaCycleAnnotatedClass", component);
  }
View Full Code Here

     * @return flag if alterBean should be invoked
     */
    private boolean shouldCallAlterBeanMethod(final MethodInvocation pMInvoc, String alterBean, Logger logger) {
        boolean callAlterBeanMethod = false;
        Method method = pMInvoc.getMethod();
        Component component = pMInvoc.getThis().getClass().getAnnotation(Component.class);
        String currentBeanName = component.value();
        if (alterBean != null && !alterBean.isEmpty()) {
            if (alterBean.equals(currentBeanName)) {
                logger.debug("FeatureFlipping on method:{} class:{} already on the alterBean {}", method.getName(), method
                        .getDeclaringClass().getName(), alterBean);
            } else {
View Full Code Here

TOP

Related Classes of org.springframework.stereotype.Component

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.