use of com.sun.enterprise.deployment.DataSourceDefinitionDescriptor in project Payara by payara.
the class DataSourceDefinitionDeployer method deployResource.
@Override
public void deployResource(Object resource) throws Exception {
final DataSourceDefinitionDescriptor desc = (DataSourceDefinitionDescriptor) resource;
String poolName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), DSDPOOL);
String resourceName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), desc.getResourceType());
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "DataSourceDefinitionDeployer.deployResource() : pool-name [" + poolName + "], " + " resource-name [" + resourceName + "]");
}
JdbcConnectionPool jdbcCp = new MyJdbcConnectionPool(desc, poolName);
// deploy pool
getDeployer(jdbcCp).deployResource(jdbcCp);
// deploy resource
JdbcResource jdbcResource = new MyJdbcResource(poolName, resourceName);
getDeployer(jdbcResource).deployResource(jdbcResource);
}
use of com.sun.enterprise.deployment.DataSourceDefinitionDescriptor in project Payara by payara.
the class DataSourceDefinitionDeployer method undeployResource.
@Override
public void undeployResource(Object resource) throws Exception {
final DataSourceDefinitionDescriptor desc = (DataSourceDefinitionDescriptor) resource;
String poolName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), DSDPOOL);
String resourceName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), desc.getResourceType());
if (_logger.isLoggable(FINE)) {
_logger.log(FINE, "DataSourceDefinitionDeployer.undeployResource() : pool-name [" + poolName + "], " + " resource-name [" + resourceName + "]");
}
// Undeploy resource
JdbcResource jdbcResource = new MyJdbcResource(poolName, resourceName);
getDeployer(jdbcResource).undeployResource(jdbcResource);
// Undeploy pool
JdbcConnectionPool jdbcCp = new MyJdbcConnectionPool(desc, poolName);
getDeployer(jdbcCp).undeployResource(jdbcCp);
desc.setDeployed(false);
}
Aggregations