Package com.techempower.data.jdbc
Class JndiConnectorFactory
java.lang.Object
com.techempower.data.jdbc.JndiConnectorFactory
- All Implemented Interfaces:
Asynchronous,ConnectorFactory,Configurable
public class JndiConnectorFactory
extends Object
implements ConnectorFactory, Configurable, Asynchronous
An implementation of ConnectorFactory that is a thin wrapper around a
connection pool defined in the servlet container (Resin, Tomcat, etc.) and
fetched via JNDI.
The following attributes are read from the properties file for configuring this component:
- [prefix]Enabled - whether this ConnectorFactory is enabled.
- [prefix]Name - JNDI name defined in servlet container.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJndiConnectorFactory(TechEmpowerApplication application, String propertyPrefix) Deprecated, for removal: This API element is subject to removal in a future version.JndiConnectorFactory(String propertyPrefix) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Start this Asynchronous component.voidconfigure(EnhancedProperties rawProps) Configure this component.voidvoidvoidend()Stop this Asynchronous component.Gets a ConnectionMonitor.booleanIs this Connector Factory enabled? In nearly all cases, this would be true; but it will be false for applications that do not connect to a database at all.
-
Field Details
-
DEFAULT_PROPERTY_PREFIX
- See Also:
-
-
Constructor Details
-
JndiConnectorFactory
Constructor. If the propertyPrefix is passed as an empty String, the default "db.Jndi." will be used.For a JNDI data source, configuration is done in the servlet container.
- Parameters:
propertyPrefix- the prefix to apply to all property names in the conf file; default is "db.Jndi."
-
JndiConnectorFactory
@Deprecated(forRemoval=true) public JndiConnectorFactory(TechEmpowerApplication application, String propertyPrefix) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
configure
Configure this component. For a JNDI data source, configuration is done in the servlet container.- Specified by:
configurein interfaceConfigurable
-
determineIdentifierQuoteString
public void determineIdentifierQuoteString()- Specified by:
determineIdentifierQuoteStringin interfaceConnectorFactory
-
begin
public void begin()Start this Asynchronous component.- Specified by:
beginin interfaceAsynchronous
-
end
public void end()Stop this Asynchronous component.- Specified by:
endin interfaceAsynchronous
-
isEnabled
public boolean isEnabled()Is this Connector Factory enabled? In nearly all cases, this would be true; but it will be false for applications that do not connect to a database at all.- Specified by:
isEnabledin interfaceConnectorFactory
-
getConnectionMonitor
Gets a ConnectionMonitor.- Specified by:
getConnectionMonitorin interfaceConnectorFactory- Throws:
SQLException
-
getIdentifierQuoteString
- Specified by:
getIdentifierQuoteStringin interfaceConnectorFactory
-
getDatabaseAffinity
- Specified by:
getDatabaseAffinityin interfaceConnectorFactory
-
determineDatabaseAffinity
public void determineDatabaseAffinity()
-