code: protected DataSource getDataSource() throws RepositoryException
     {
        try
        {
           return containerConfig.dsProvider.getDataSource(containerConfig.dbSourceName);
        }
        catch (NamingException e)
        {
           throw new RepositoryException("Datasource '" + containerConfig.dbSourceName
              + "' is not bound in this context.", e);
        }
     }
docs: Get the data source from the InitialContext and wraps it into a {@link ManagedDataSource}
  in case it has been configured as managed