Re: [Dev] Overriding getDataSource(String dsName) method in ApplicationAwareDataSourceRepository

2015-02-17 Thread Manjula Rathnayake
Hi all,

Above changes are committed as we could not identify any regression issues
so far.

thank you.

On Mon, Feb 16, 2015 at 5:47 PM, Manjula Rathnayake 
wrote:

> Hi all,
>
> I noticed that $Subject is not done while investigating issue[1]. Any
> reason, known issues for not overriding the above method?
>
> *Suggested fix:*
> @Override
> public CarbonDataSource getDataSource(String dsName) {
> String appId = Util.getCurrentArtifactName();
> if (!StringUtils.isEmpty(appId)) {
> return getDataSource(dsName, appId);
> }
> return super.getDataSource(dsName);
> }
>
> *Usage:*
> CarbonDataSource carbonDataSource =
> dataSourceManager.getInstance().getDataSourceRepository().getDataSource(dataSourceName);
> DataSource dataSource = (DataSource) carbonDataSource.getDSObject();
>
> [1]. https://wso2.org/jira/browse/APPFAC-2901
>
> thank you.
>
> --
> Manjula Rathnayaka
> Software Engineer
> WSO2, Inc.
> Mobile:+94 77 743 1987
>



-- 
Manjula Rathnayaka
Software Engineer
WSO2, Inc.
Mobile:+94 77 743 1987
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Overriding getDataSource(String dsName) method in ApplicationAwareDataSourceRepository

2015-02-16 Thread Manjula Rathnayake
Hi all,

I noticed that $Subject is not done while investigating issue[1]. Any
reason, known issues for not overriding the above method?

*Suggested fix:*
@Override
public CarbonDataSource getDataSource(String dsName) {
String appId = Util.getCurrentArtifactName();
if (!StringUtils.isEmpty(appId)) {
return getDataSource(dsName, appId);
}
return super.getDataSource(dsName);
}

*Usage:*
CarbonDataSource carbonDataSource =
dataSourceManager.getInstance().getDataSourceRepository().getDataSource(dataSourceName);
DataSource dataSource = (DataSource) carbonDataSource.getDSObject();

[1]. https://wso2.org/jira/browse/APPFAC-2901

thank you.

-- 
Manjula Rathnayaka
Software Engineer
WSO2, Inc.
Mobile:+94 77 743 1987
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev