diff geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEConnection.java @ 129:110e3ac1b7d2

Library Dependencies Added to pom.xml-File Import of SDE-Datasources geo-backend/trunk@5 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 02 Sep 2009 09:07:03 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEConnection.java	Wed Sep 02 09:07:03 2009 +0000
@@ -0,0 +1,72 @@
+/**
+ * Title:           SdeConnection, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/sde/SDEConnection.java,v 1.4 2008/01/30 12:38:34 blume Exp $
+ * Source:          $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/sde/SDEConnection.java,v $
+ * created by:      Stefan Blume (blume)
+ * erstellt am:     21.11.2007
+ * Copyright:       con terra GmbH, 2005
+ *
+ * modified by:     $Author: blume $
+ * modified on:     $Date: 2008/01/30 12:38:34 $
+ * Version:         $Revision: 1.4 $
+ * TAG:             $Name:  $
+ * locked from:     $Locker:  $
+ * CVS State:       $State: Exp $
+ * Project:         $ProjectName$
+ */
+package de.intevation.gnv.geobackend.sde.datasources;
+
+import org.apache.log4j.Logger;
+
+import com.esri.sde.sdk.client.SeConnection;
+
+import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException;
+
+/**
+ * The class <code>SDEConnection</code> fulfills the following purposes:
+ * <ol>
+ * <li>Providing an implementation of DatasourceConnection-Interface for a SDE database.</li>
+ * </ol>
+ *
+ * @author blume
+ * @version 1.0
+ * @serial 1.0
+ * @see
+ * @since 21.11.2007 08:51:43
+ */
+public class SDEConnection implements DatasourceConnection {
+
+    /**
+     * Default Logging instance
+     */
+    private static final Logger sLogger = Logger.getLogger(SDEConnection.class);
+    private static boolean sDebug = sLogger.isDebugEnabled();
+
+    public SDEConnection() {
+    }
+
+    /**
+     * Get a SeConnection. Therefore this method will ask {@link de.conterra.bsh.gdi.gnviewer.datasources.sde.ArcSDEConnectionPool} for a connection.
+     *
+     * @return SeConnection
+     * @throws TechnicalException
+     */
+    public SeConnection getConnection() throws TechnicalException {
+        if (sDebug) sLogger.debug("getConnection()");
+        return ArcSDEConnectionPool.getInstance().getConnection();
+    }
+
+    /**
+     * Return a connection (to a connection pool).
+     * This method is executed after an executed query.
+     *
+     * @param pConnection the connection used for a query.
+     */
+    public void returnConnection(SeConnection pConnection) {
+        if (sDebug) sLogger.debug("returnConnection()");
+        try {
+            ArcSDEConnectionPool.getInstance().returnConnection(pConnection);
+        } catch (TechnicalException e) {
+            sLogger.error(e.getMessage(), e);
+        }
+    }
+}

http://dive4elements.wald.intevation.org