org.geotools.data.arcsde
Class ArcSDEConnectionPool

java.lang.Object
  extended byorg.geotools.data.arcsde.ArcSDEConnectionPool

public class ArcSDEConnectionPool
extends java.lang.Object

Maintains SeConnection's for a single set of connection properties (for instance: by server, port, user and password) in a pooled way

Since sde connections are not jdbc connections, I can't use Sean's excellent connection pool. So I'll borrow most of it.

This connection pool is configurable in the sense that some parameters can be passed to establish the pooling policy. To pass parameters to the connection pool, you should set some properties in the parameters Map passed to SdeDataStoreFactory.createDataStore, wich will invoke SdeConnectionPoolFactory to get the SDE instance's pool singleton. That instance singleton will be created with the preferences passed the first time createDataStore is called for a given SDE instance/user, if subsecuent calls change that preferences, they will be ignored.

The expected optional parameters that you can set up in the argument Map for createDataStore are:

Version:
$Id: ArcSDEConnectionPool.java 18131 2006-02-21 11:11:44Z groldan $
Author:
Gabriel Roldan, Axios Engineering

Field Summary
static int DEFAULT_CONNECTIONS
          default number of connections a pool creates at first population
static int DEFAULT_MAX_CONNECTIONS
          default number of maximun allowable connections a pool can hold
static int DEFAULT_MAX_WAIT_TIME
           
protected static java.util.logging.Level INFO_LOG_LEVEL
          DOCUMENT ME!
protected static java.util.logging.Logger LOGGER
          package's logger
 
Constructor Summary
protected ArcSDEConnectionPool(ConnectionConfig config)
          Creates a new SdeConnectionPool object with the connection parameters holded by config
 
Method Summary
 void close()
          closes all connections in this pool
 int getAvailableCount()
          TODO: Document this method!
 java.util.List getAvailableLayerNames()
          Gets the list of available layer names on the database
 ConnectionConfig getConfig()
          DOCUMENT ME!
 org.geotools.data.arcsde.PooledConnection getConnection()
          DOCUMENT ME!
 int getInUseCount()
          TODO: Document this method!
 int getPoolSize()
          returns the number of actual connections holded by this connection pool.
 com.esri.sde.sdk.client.SeLayer getSdeLayer(com.esri.sde.sdk.client.SeConnection conn, java.lang.String typeName)
          DOCUMENT ME!
 com.esri.sde.sdk.client.SeLayer getSdeLayer(java.lang.String typeName)
           
 com.esri.sde.sdk.client.SeTable getSdeTable(com.esri.sde.sdk.client.SeConnection conn, java.lang.String tableName)
          DOCUMENT ME!
 com.esri.sde.sdk.client.SeTable getSdeTable(java.lang.String tableName)
           
 boolean isClosed()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER
package's logger


INFO_LOG_LEVEL

protected static final java.util.logging.Level INFO_LOG_LEVEL
DOCUMENT ME!


DEFAULT_CONNECTIONS

public static final int DEFAULT_CONNECTIONS
default number of connections a pool creates at first population

See Also:
Constant Field Values

DEFAULT_MAX_CONNECTIONS

public static final int DEFAULT_MAX_CONNECTIONS
default number of maximun allowable connections a pool can hold

See Also:
Constant Field Values

DEFAULT_MAX_WAIT_TIME

public static final int DEFAULT_MAX_WAIT_TIME
See Also:
Constant Field Values
Constructor Detail

ArcSDEConnectionPool

protected ArcSDEConnectionPool(ConnectionConfig config)
                        throws DataSourceException
Creates a new SdeConnectionPool object with the connection parameters holded by config

Parameters:
config - holds connection options such as server, user and password, as well as tuning options as maximun number of connections allowed
Throws:
DataSourceException - DOCUMENT ME!
java.lang.NullPointerException - DOCUMENT ME!
Method Detail

getPoolSize

public int getPoolSize()
returns the number of actual connections holded by this connection pool. In other words, the sum of used and available connections, regardless

Returns:
DOCUMENT ME!

close

public void close()
closes all connections in this pool


getAvailableCount

public int getAvailableCount()
TODO: Document this method!

Returns:
DOCUMENT ME!

getInUseCount

public int getInUseCount()
TODO: Document this method!

Returns:
DOCUMENT ME!

getConnection

public org.geotools.data.arcsde.PooledConnection getConnection()
                                                        throws DataSourceException,
                                                               UnavailableConnectionException
DOCUMENT ME!

Returns:
DOCUMENT ME!
Throws:
DataSourceException - DOCUMENT ME!
UnavailableConnectionException
java.lang.IllegalStateException - DOCUMENT ME!

getSdeTable

public com.esri.sde.sdk.client.SeTable getSdeTable(java.lang.String tableName)
                                            throws DataSourceException
Throws:
DataSourceException

getSdeTable

public com.esri.sde.sdk.client.SeTable getSdeTable(com.esri.sde.sdk.client.SeConnection conn,
                                                   java.lang.String tableName)
                                            throws DataSourceException
DOCUMENT ME!

Parameters:
tableName - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
DataSourceException - DOCUMENT ME!

getSdeLayer

public com.esri.sde.sdk.client.SeLayer getSdeLayer(java.lang.String typeName)
                                            throws java.util.NoSuchElementException,
                                                   java.io.IOException
Throws:
java.util.NoSuchElementException
java.io.IOException

getSdeLayer

public com.esri.sde.sdk.client.SeLayer getSdeLayer(com.esri.sde.sdk.client.SeConnection conn,
                                                   java.lang.String typeName)
                                            throws java.util.NoSuchElementException,
                                                   java.io.IOException
DOCUMENT ME!

Parameters:
typeName - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!

getAvailableLayerNames

public java.util.List getAvailableLayerNames()
                                      throws DataSourceException
Gets the list of available layer names on the database

Returns:
a List<String> with the registered featureclasses on the ArcSDE database
Throws:
DataSourceException

isClosed

public boolean isClosed()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getConfig

public ConnectionConfig getConfig()
DOCUMENT ME!

Returns:
DOCUMENT ME!


Copyright © GeoTools. All Rights Reserved.