use of com.sun.enterprise.connectors.util.ResourcesUtil in project Payara by payara.
the class JdbcDataSource method validateResource.
private void validateResource(ResourceInfo resourceInfo) throws ConnectorRuntimeException {
ResourcesUtil resourcesUtil = ResourcesUtil.createInstance();
String jndiName = resourceInfo.getName();
String suffix = ConnectorsUtil.getValidSuffix(jndiName);
if (suffix != null) {
// Typically, resource is created without suffix. Try without suffix.
String tmpJndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix));
if (resourcesUtil.getResource(tmpJndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName(), JdbcResource.class) != null) {
return;
}
}
if (resourcesUtil.getResource(resourceInfo, JdbcResource.class) == null) {
throw new ConnectorRuntimeException("Invalid resource : " + resourceInfo);
}
}
Aggregations