Package org.nuxeo.runtime.datasource
Class DataSourceHelper
java.lang.Object
org.nuxeo.runtime.datasource.DataSourceHelper
Helper class to look up 
DataSources without having to deal with vendor-specific JNDI prefixes.- Author:
 - Thierry Delprat, Florent Guillaume
 
- 
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourcegetDataSource(String partialName) Look up a datasource given a partial name.static DataSourcegetDataSource(String partialName, boolean noSharing) Look up a datasource given a partial name.static <T> TgetDataSource(String name, Class<T> clazz) static <T> TgetDataSource(String name, Class<T> clazz, boolean noSharing) static StringgetDataSourceJNDIName(String name) Look up a datasource JNDI name given a partial name.protected static Stringrelativize(String name)  
- 
Method Details
- 
getDataSourceJNDIName
Look up a datasource JNDI name given a partial name.For a datasource
"jdbc/foo", then it's sufficient to pass"foo"to this method.- Returns:
 - the datasource JNDI name
 
 - 
relativize
 - 
getDataSource
Look up a datasource given a partial name.For a datasource
"jdbc/foo", then it's sufficient to pass"foo"to this method.- Parameters:
 partialName- the partial name- Returns:
 - the datasource
 - Throws:
 NamingException
 - 
getDataSource
public static DataSource getDataSource(String partialName, boolean noSharing) throws NamingException Look up a datasource given a partial name.For a datasource
"jdbc/foo", then it's sufficient to pass"foo"to this method.- Parameters:
 partialName- the partial namenoSharing-trueto request an unshared datasource- Returns:
 - the datasource
 - Throws:
 NamingException
 - 
getDataSource
- Throws:
 NamingException
 - 
getDataSource
public static <T> T getDataSource(String name, Class<T> clazz, boolean noSharing) throws NamingException - Throws:
 NamingException
 
 -