2021-09-20 16:47:35 +02:00
|
|
|
package org.gcube.application.geoportal.service.engine.providers;
|
|
|
|
|
|
|
|
import org.gcube.application.geoportal.service.engine.postgis.PostgisDBManager;
|
2022-02-04 17:45:47 +01:00
|
|
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
2021-09-20 16:47:35 +02:00
|
|
|
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
public class PostgisConnectionProvider extends AbstractScopedMap<PostgisDBManager>{
|
|
|
|
|
|
|
|
|
|
|
|
public PostgisConnectionProvider() {
|
|
|
|
super("Postgis connection descriptor cache");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected PostgisDBManager retrieveObject() throws ConfigurationException {
|
|
|
|
try {
|
|
|
|
return PostgisDBManager.get();
|
|
|
|
} catch (SQLException throwables) {
|
|
|
|
throw new ConfigurationException(throwables);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void dispose(PostgisDBManager toDispose) {
|
|
|
|
// toDispose.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void init() {
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|