if(!enterpriseBean.getJBossMetaData().isEJB31())
{
return null;
}
DataSourcesMetaData dataSources = new DataSourcesMetaData();
// datasources on the EJB
if (enterpriseBean.getDataSources() != null)
{
dataSources.addAll(enterpriseBean.getDataSources());
}
// datasources on the interceptors of the EJB
InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(enterpriseBean.getEjbName(), enterpriseBean.getJBossMetaData());
if (interceptors != null)
{
for (InterceptorMetaData interceptor : interceptors)
{
if (interceptor == null || interceptor.getDataSources() == null)
{
continue;
}
dataSources.addAll(interceptor.getDataSources());
}
}
return dataSources;
}