[ 
https://issues.apache.org/jira/browse/IGNITE-6531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16472268#comment-16472268
 ] 

Dmitriy Pavlov commented on IGNITE-6531:
----------------------------------------

Hi [~skylark-nam] I did not understood which problem this fix will solve.

We can ignore absent bean defenition, by why? Is required=false is error-prone 
approach?

 

СС [~dmagda] please correct me if I'm wrong and it is popular ask coming from 
users.

> Need to add a 'required' field to the SpringResource annotation.
> ----------------------------------------------------------------
>
>                 Key: IGNITE-6531
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6531
>             Project: Ignite
>          Issue Type: Improvement
>          Components: spring
>    Affects Versions: 2.3
>            Reporter: joungdal.nam
>            Assignee: joungdal.nam
>            Priority: Minor
>              Labels: easyfix, newbie
>             Fix For: 2.6
>
>
> 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;
>                       }
>               }
>         }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to