Skip to content

Commit

Permalink
[ARIES-1745] Change property name and convert to boolean
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/aries/trunk@1810225 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
alien11689 committed Sep 30, 2017
1 parent 4dfb136 commit c5e9167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</executions>
<configuration>
<customParameters>
<blueprint.beanFromFactory.name>fromFactoryMethodName</blueprint.beanFromFactory.name>
<blueprint.beanFromFactory.nameFromFactoryMethodName>true</blueprint.beanFromFactory.nameFromFactoryMethodName>
</customParameters>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import java.lang.reflect.Method;

class BeanFromFactory extends Bean {
private static final String BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY = "blueprint.beanFromFactory.name";
private static final String BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY_VALUE = "fromFactoryMethodName";
private static final String BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY = "blueprint.beanFromFactory.nameFromFactoryMethodName";
private final Method producingMethod;

BeanFromFactory(Bean factoryBean, Method factoryMethod, ContextEnricher contextEnricher) {
Expand All @@ -47,8 +46,8 @@ class BeanFromFactory extends Bean {
}

private boolean shouldGetBeanNameFromMethodName(ContextEnricher contextEnricher) {
String beanFromFactoryName = contextEnricher.getBlueprintConfiguration().getCustomParameters().get(BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY);
return BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY_VALUE.equals(beanFromFactoryName);
String value = contextEnricher.getBlueprintConfiguration().getCustomParameters().get(BLUEPRINT_BEAN_FROM_FACTORY_NAME_PROPERTY);
return Boolean.parseBoolean(value);
}

private void setScope(Method factoryMethod) {
Expand Down

0 comments on commit c5e9167

Please sign in to comment.