org.geotools.data.jdbc.datasource
Class DBCPDataSourceFactory

Object
  extended by AbstractDataSourceFactorySpi
      extended by DBCPDataSourceFactory
All Implemented Interfaces:
DataSourceFactorySpi, Factory

public class DBCPDataSourceFactory
extends AbstractDataSourceFactorySpi

A datasource factory using DBCP connection pool

Author:
Andrea Aime - TOPP

Field Summary
static DataAccessFactory.Param DRIVERCLASS
           
static DataAccessFactory.Param DSTYPE
           
static DataAccessFactory.Param JDBC_URL
           
static DataAccessFactory.Param MAXACTIVE
           
static DataAccessFactory.Param MAXIDLE
           
static DataAccessFactory.Param PASSWORD
           
static DataAccessFactory.Param USERNAME
           
 
Constructor Summary
DBCPDataSourceFactory()
           
 
Method Summary
 boolean canProcess(Map params)
          Test to see if this factory is suitable for processing the data pointed to by the params map.
 DataSource createDataSource(Map params)
          Construct a live data source using the params specifed.
 DataSource createNewDataSource(Map params)
          Same as DataSourceFactorySpi.createDataSource(Map), but forces the creation of a new DataSource
 String getDescription()
          Describe the nature of the data source constructed by this factory.
 DataAccessFactory.Param[] getParametersInfo()
          MetaData about the required Parameters (for DataSourceFactorySpi.createDataSource(Map)).
 boolean isAvailable()
          Test to see if this data source is available, if it has all the appropriate libraries to construct a datastore.
 
Methods inherited from class AbstractDataSourceFactorySpi
getDisplayName, getImplementationHints
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSTYPE

public static final DataAccessFactory.Param DSTYPE

USERNAME

public static final DataAccessFactory.Param USERNAME

PASSWORD

public static final DataAccessFactory.Param PASSWORD

JDBC_URL

public static final DataAccessFactory.Param JDBC_URL

DRIVERCLASS

public static final DataAccessFactory.Param DRIVERCLASS

MAXACTIVE

public static final DataAccessFactory.Param MAXACTIVE

MAXIDLE

public static final DataAccessFactory.Param MAXIDLE
Constructor Detail

DBCPDataSourceFactory

public DBCPDataSourceFactory()
Method Detail

createDataSource

public DataSource createDataSource(Map params)
                            throws IOException
Description copied from interface: DataSourceFactorySpi
Construct a live data source using the params specifed. The returned DataSource may be pooled.

Parameters:
params - The full set of information needed to construct a live DataSource.
Returns:
The created DataSource, this may be null if the required resource was not found or if insufficent parameters were given. Note that canProcess() should have returned false if the problem is to do with insuficent parameters.
Throws:
IOException - if there were any problems setting up (creating or connecting) the datasource.

canProcess

public boolean canProcess(Map params)
Description copied from interface: DataSourceFactorySpi
Test to see if this factory is suitable for processing the data pointed to by the params map.

If this data source requires a number of parameters then this mehtod should check that they are all present and that they are all valid.

Specified by:
canProcess in interface DataSourceFactorySpi
Overrides:
canProcess in class AbstractDataSourceFactorySpi
Parameters:
params - The full set of information needed to construct a live data source.
Returns:
booean true if and only if this factory can process the resource indicated by the param set and all the required params are pressent.

createNewDataSource

public DataSource createNewDataSource(Map params)
                               throws IOException
Description copied from interface: DataSourceFactorySpi
Same as DataSourceFactorySpi.createDataSource(Map), but forces the creation of a new DataSource

Returns:
Throws:
IOException

getDescription

public String getDescription()
Description copied from interface: DataSourceFactorySpi
Describe the nature of the data source constructed by this factory.

A non localized description of this data store type.

Returns:
A human readable description that is suitable for inclusion in a list of available datasources.

getParametersInfo

public DataAccessFactory.Param[] getParametersInfo()
Description copied from interface: DataSourceFactorySpi
MetaData about the required Parameters (for DataSourceFactorySpi.createDataSource(Map)).

Returns:
Param array describing the Map for createDataStore

isAvailable

public boolean isAvailable()
Description copied from interface: DataSourceFactorySpi
Test to see if this data source is available, if it has all the appropriate libraries to construct a datastore.

Returns:
true if and only if this factory has all the appropriate jars on the classpath to create DataSource.


Copyright © 1996-2014 Geotools. All Rights Reserved.