|
Fish & Chips Club 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object ConnectionSrc
public class ConnectionSrc
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 |
---|
public static final String DEFAULT
public static final String ACCESS_CONTROL
public static final String TRANSLATION
Constructor Detail |
---|
public ConnectionSrc()
Method Detail |
---|
public final void init(Map<String,String> aConfig)
init
in interface ConnectionSource
public final Set<String> getDatabaseNames()
DEFAULT
, ACCESS_CONTROL
,
and TRANSLATION
.
getDatabaseNames
in interface ConnectionSource
public final Connection getConnection() throws DAOException
Connection
for the default database.
getConnection
in interface ConnectionSource
DAOException
public final Connection getConnection(String aDatabaseName) throws DAOException
Connection
for the identified database.
getConnection
in interface ConnectionSource
aDatabaseName
- one of the values DEFAULT
,
TRANSLATION
, or ACCESS_CONTROL
.
DAOException
protected Connection getConnectionByName(String aDbName) throws DAOException
DAOException
protected String getConnectionString(String aDbName)
|
Fish & Chips Club 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |