Fish & Chips Club 4.10.0.0

hirondelle.web4j.config
Class ConnectionSrc

Object
  extended by ConnectionSrc
All Implemented Interfaces:
ConnectionSource
Direct Known Subclasses:
FakeConnectionSrc

public class ConnectionSrc
extends Object
implements ConnectionSource

Implementation of ConnectionSource, required by WEB4J.

This implementation uses a Connection pool managed by the container. This class is non-final only since it is convenient for FakeConnectionSrc. Only one method can be overridden - getConnectionByName(String).


Field Summary
static String ACCESS_CONTROL
          Name used to identify the access control database (users, roles, etc.).
static String DEFAULT
          Name used to identify the default database.
static String TRANSLATION
          Name used to identify the translation database.
 
Constructor Summary
ConnectionSrc()
           
 
Method Summary
 Connection getConnection()
          Return a Connection for the default database.
 Connection getConnection(String aDatabaseName)
          Return a Connection for the identified database.
protected  Connection getConnectionByName(String aDbName)
          This method can be overridden by a subclass.
protected  String getConnectionString(String aDbName)
          This item is protected, in order to make it visible to any subclasses created for testing outside of the normal runtime environment.
 Set<String> getDatabaseNames()
          Return value contains only DEFAULT, ACCESS_CONTROL, and TRANSLATION.
 void init(Map<String,String> aConfig)
          Read in connection strings from web.xml.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final String DEFAULT
Name used to identify the default database. The default database is the main database, carrying core business data. It is the data that is most often accessed.

See Also:
Constant Field Values

ACCESS_CONTROL

public static final String ACCESS_CONTROL
Name used to identify the access control database (users, roles, etc.).

See Also:
Constant Field Values

TRANSLATION

public static final String TRANSLATION
Name used to identify the translation database.

See Also:
Constant Field Values
Constructor Detail

ConnectionSrc

public ConnectionSrc()
Method Detail

init

public final void init(Map<String,String> aConfig)
Read in connection strings from web.xml.

Specified by:
init in interface ConnectionSource

getDatabaseNames

public final Set<String> getDatabaseNames()
Return value contains only DEFAULT, ACCESS_CONTROL, and TRANSLATION.

Specified by:
getDatabaseNames in interface ConnectionSource

getConnection

public final Connection getConnection()
                               throws DAOException
Return a Connection for the default database.

Specified by:
getConnection in interface ConnectionSource
Throws:
DAOException

getConnection

public final Connection getConnection(String aDatabaseName)
                               throws DAOException
Return a Connection for the identified database.

Specified by:
getConnection in interface ConnectionSource
Parameters:
aDatabaseName - one of the values DEFAULT, TRANSLATION, or ACCESS_CONTROL.
Throws:
DAOException

getConnectionByName

protected Connection getConnectionByName(String aDbName)
                                  throws DAOException
This method can be overridden by a subclass. Such overrides are intended for testing.

Throws:
DAOException

getConnectionString

protected String getConnectionString(String aDbName)
This item is protected, in order to make it visible to any subclasses created for testing outside of the normal runtime environment.


Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26