T
- The resource typepublic abstract class AbstractConnectionFactory<T> extends Object implements ConnectionFactory<T>
Modifier and Type | Field and Description |
---|---|
protected ConfigurationHolder |
factoryConfigurationHolder
The configuration holder
|
protected Logger |
LOGGER
The logger
|
Constructor and Description |
---|
AbstractConnectionFactory()
This is the class constructor.
|
Modifier and Type | Method and Description |
---|---|
Connection<T> |
createConnection()
Creates and returns the connection to be used.
|
protected Connection<T> |
createConnectionForResource(T resource)
Creates and returns the connection to be used.
|
protected abstract T |
createResourceImpl()
Creates and returns the resource.
|
void |
initialize(ConfigurationHolder configurationHolder)
This function initializes the connection factory.
|
protected abstract void |
initializeImpl()
This function initializes the connection factory.
|
void |
releaseConnection(Connection<T> connection)
Releases the connection.
|
protected void |
releaseResource(T resource)
Releases the resource from the connection.
|
protected abstract void |
releaseResourceImpl(T resource)
Releases the resource from the connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProvider
protected final Logger LOGGER
protected ConfigurationHolder factoryConfigurationHolder
public AbstractConnectionFactory()
public final void initialize(ConfigurationHolder configurationHolder)
initialize
in interface ConnectionFactory<T>
configurationHolder
- The configuration holderpublic Connection<T> createConnection()
createConnection
in interface ConnectionFactory<T>
public void releaseConnection(Connection<T> connection)
releaseConnection
in interface ConnectionFactory<T>
connection
- The connectionprotected final Connection<T> createConnectionForResource(T resource)
resource
- The resource held by the connectionprotected void releaseResource(T resource)
resource
- The resourceprotected abstract void initializeImpl()
protected abstract T createResourceImpl()
protected abstract void releaseResourceImpl(T resource)
resource
- The resourceCopyright © 2009–2020 fax4j. All rights reserved.