Examples of findAnnotationOnBean()


Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

    final ConfigurableListableBeanFactory beanFactory = getBeanFactory();
    final Class<?> beanType = beanFactory.getType(beanName);
    if (beanType == null) {
      return Collections.emptyList();
    }
    final WebScript webScriptAnnotation = beanFactory.findAnnotationOnBean(beanName, WebScript.class) != null ? beanFactory
        .findAnnotationOnBean(beanName, WebScript.class) : getDefaultWebScriptAnnotation();
    final String baseUri = webScriptAnnotation.baseUri();
    if (StringUtils.hasText(baseUri) && baseUri.startsWith("/") == false) {
      throw new RuntimeException(String.format(
          "@WebScript baseUri for class '%s' does not start with a slash: '%s'", beanType, baseUri));
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

    final ConfigurableListableBeanFactory beanFactory = getBeanFactory();
    final Class<?> beanType = beanFactory.getType(beanName);
    if (beanType == null) {
      return Collections.emptyList();
    }
    final WebScript webScriptAnnotation = beanFactory.findAnnotationOnBean(beanName, WebScript.class) != null ? beanFactory
        .findAnnotationOnBean(beanName, WebScript.class) : getDefaultWebScriptAnnotation();
    final String baseUri = webScriptAnnotation.baseUri();
    if (StringUtils.hasText(baseUri) && baseUri.startsWith("/") == false) {
      throw new RuntimeException(String.format(
          "@WebScript baseUri for class '%s' does not start with a slash: '%s'", beanType, baseUri));
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

  protected void handleTypeAnnotations(final String beanName, final WebScript webScript,
      final DescriptionImpl description) {
    final ConfigurableListableBeanFactory beanFactory = getBeanFactory();
    handleWebScriptAnnotation(webScript, beanName, description);
    Authentication authentication = beanFactory.findAnnotationOnBean(beanName, Authentication.class);
    if (authentication == null) {
      authentication = getDefaultAuthenticationAnnotation();
    }
    handleAuthenticationAnnotation(authentication, beanName, description);
    Transaction transaction = beanFactory.findAnnotationOnBean(beanName, Transaction.class);
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

    Authentication authentication = beanFactory.findAnnotationOnBean(beanName, Authentication.class);
    if (authentication == null) {
      authentication = getDefaultAuthenticationAnnotation();
    }
    handleAuthenticationAnnotation(authentication, beanName, description);
    Transaction transaction = beanFactory.findAnnotationOnBean(beanName, Transaction.class);
    if (transaction == null) {
      transaction = getDefaultTransactionAnnotation();
    }
    handleTransactionAnnotation(transaction, beanName, description);
    Cache cache = beanFactory.findAnnotationOnBean(beanName, Cache.class);
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

    Transaction transaction = beanFactory.findAnnotationOnBean(beanName, Transaction.class);
    if (transaction == null) {
      transaction = getDefaultTransactionAnnotation();
    }
    handleTransactionAnnotation(transaction, beanName, description);
    Cache cache = beanFactory.findAnnotationOnBean(beanName, Cache.class);
    if (cache == null) {
      cache = getDefaultCacheAnnotation();
    }
    handleCacheAnnotation(cache, beanName, description);
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean()

    final String webscriptId = "webscriptId";
    AnnotationWebScriptBuilder builder = new AnnotationWebScriptBuilder();
    ConfigurableListableBeanFactory dummyBeanFactory = mock(ConfigurableListableBeanFactory.class);
    when(dummyBeanFactory.getType(webscriptId)).thenAnswer(new Returns(DuplicateIdWebScript.class));
    final DuplicateIdWebScript instance = new DuplicateIdWebScript();
    when(dummyBeanFactory.findAnnotationOnBean(webscriptId, WebScript.class)).thenReturn(instance.getClass().getAnnotation(WebScript.class));
    when(dummyBeanFactory.getBean(webscriptId)).thenReturn(instance);

    builder.setBeanFactory(dummyBeanFactory);
    try {
      builder.createWebScripts(webscriptId);
View Full Code Here

Examples of org.springframework.beans.factory.generic.GenericBeanFactoryAccessor.findAnnotationOnBean()

    for (String beanName : beanNames) {
      Class<?> handlerType = context.getType(beanName);
      ListableBeanFactory bf = (context instanceof ConfigurableApplicationContext ?
          ((ConfigurableApplicationContext) context).getBeanFactory() : context);
      GenericBeanFactoryAccessor bfa = new GenericBeanFactoryAccessor(bf);
      RequestMapping mapping = bfa.findAnnotationOnBean(beanName, RequestMapping.class);
      if (mapping != null) {
        String[] modeKeys = mapping.value();
        String[] params = mapping.params();
        boolean registerHandlerType = true;
        if (modeKeys.length == 0 || params.length == 0) {
View Full Code Here

Examples of org.springframework.beans.factory.generic.GenericBeanFactoryAccessor.findAnnotationOnBean()

    ApplicationContext context = getApplicationContext();
    Class<?> handlerType = context.getType(beanName);
    ListableBeanFactory bf = (context instanceof ConfigurableApplicationContext ?
        ((ConfigurableApplicationContext) context).getBeanFactory() : context);
    GenericBeanFactoryAccessor bfa = new GenericBeanFactoryAccessor(bf);
    RequestMapping mapping = bfa.findAnnotationOnBean(beanName, RequestMapping.class);

    if (mapping != null) {
      // @RequestMapping found at type level
      this.cachedMappings.put(handlerType, mapping);
      Set<String> urls = new LinkedHashSet<String>();
View Full Code Here

Examples of org.springframework.context.ApplicationContext.findAnnotationOnBean()

  protected void detectHandlers() throws BeansException {
    ApplicationContext context = getApplicationContext();
    String[] beanNames = context.getBeanNamesForType(Object.class);
    for (String beanName : beanNames) {
      Class<?> handlerType = context.getType(beanName);
      RequestMapping mapping = context.findAnnotationOnBean(beanName, RequestMapping.class);
      if (mapping != null) {
        // @RequestMapping found at type level
        this.cachedMappings.put(handlerType, mapping);
        String[] modeKeys = mapping.value();
        String[] params = mapping.params();
View Full Code Here

Examples of org.springframework.context.ApplicationContext.findAnnotationOnBean()

   */
  @Override
  protected String[] determineUrlsForHandler(String beanName) {
    ApplicationContext context = getApplicationContext();
    Class<?> handlerType = context.getType(beanName);
    RequestMapping mapping = context.findAnnotationOnBean(beanName, RequestMapping.class);
    if (mapping != null) {
      // @RequestMapping found at type level
      this.cachedMappings.put(handlerType, mapping);
      Set<String> urls = new LinkedHashSet<String>();
      String[] typeLevelPatterns = mapping.value();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.