Hi all, I create git issue[1] to track this improvement and the PR[2] with the fix. Can you please review the fix.
1. https://github.com/wso2/carbon-config/issues/63 2. https://github.com/wso2/carbon-config/pull/64 Thanks Danesh On Tue, Nov 28, 2017 at 6:35 PM, Danesh Kuruppu <[email protected]> wrote: > Hi all, > > In current config provider implementation, if we need to generate > configuration object by reading deployment yaml, we need to add > Configuration annotation with a namespace to the bean class. > > But there can be situation where adding annotation to the bean class is > not possible. but we still need to generate the bean object by reading the > deployment yaml. This limitation occurred because when we are generating > bean object from the provider, we get the namespace of the particular bean > class from the Configuration annotation. If there is no annotation define > in the class or namespace not exists in the deployment.yaml, system > generates the object with default values. > > In order to overcome this scenario, we are going to provide new method in > configProvider service object. So that user can provide the namespace and > as well as the bean class like below, > > <T extends Object> T getConfigurationObject(String namespace, Class<T> >> configClass) > > > When we call the method, we first check the configuration for the > namespace, if configuration exists in deployment.yaml, system generates > bean object by overriding the configuration of the namespace. Here we are > not checking the namespace of the bean class. > > If the given namespace is null or doesn't have configuration for the > namespace. then system checks the bean namespace and generate the bean > object. > > Appreciate your input on this. > > *Danesh Kuruppu* > Senior Software Engineer | WSO2 > > Email: [email protected] > Mobile: +94 (77) 1690552 <+94%2077%20169%200552> > Web: WSO2 Inc <https://wso2.com/signature> > > -- *Danesh Kuruppu* Senior Software Engineer | WSO2 Email: [email protected] Mobile: +94 (77) 1690552 Web: WSO2 Inc <https://wso2.com/signature>
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
