Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6531

Need to add a 'required' field to the SpringResource annotation.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.3
    • None
    • spring

    Description

      In my test environment, only the client is used(setForceServerMode(true)). Operating environments use clients and servers.
      Sometimes Injection is not required in the test environment.
      NoSuchBeanDefinitionException is not generated by specifying a value of false.

      public @interface SpringResource {

      /**

      • Declares whether the annotated dependency is required.
      • <p>Defaults to {@code true}

        .
        */
        boolean required() default true;
        ..

      if (!StringUtils.isEmpty(beanName)) {
      try

      { bean = springCtx.getBean(beanName); }

      catch(NoSuchBeanDefinitionException ne) {
      if(annotation.required())

      { throw ne; }
      }
      }
      else {
      try { bean = springCtx.getBean(beanCls); } catch(NoSuchBeanDefinitionException ne) {
      if(annotation.required()) { throw ne; }

      }
      }

      Attachments

        Issue Links

          Activity

            People

              skylark-nam joungdal.nam
              skylark-nam joungdal.nam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: