ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "joungdal.nam (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-6531) Need to add a 'required' field to the SpringResource annotation.
Date Mon, 02 Jul 2018 12:40:00 GMT

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

joungdal.nam edited comment on IGNITE-6531 at 7/2/18 12:39 PM:
---------------------------------------------------------------

please read outlink

[mail thread|https://lists.apache.org/thread.html/%3CCAFhuo56MB8ppk3+6XGPKgKz_jg-kBdaPj7CjLYEYtc+qbzxpQA@mail.gmail.com%3E]


was (Author: skylark-nam):
please read outlink

[mail thread|https://lists.apache.org/list.html?dev@ignite.apache.org:lte=1M:joungdal.nam]

> 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
>
> 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)

Mime
View raw message