Class DelegatingConnectionFactory
- java.lang.Object
- org.springframework.jca.cci.connection.DelegatingConnectionFactory
- All Implemented Interfaces:
Serializable
,Referenceable
,ConnectionFactory
,Referenceable
,InitializingBean
- Direct Known Subclasses:
ConnectionSpecConnectionFactoryAdapter
,SingleConnectionFactory
,TransactionAwareConnectionFactoryProxy
public class DelegatingConnectionFactory extends Object implements ConnectionFactory, InitializingBean
CCIConnectionFactory
implementation that delegates all calls to a given targetConnectionFactory
.This class is meant to be subclassed, with subclasses overriding only those methods (such as
getConnection()
) that should not simply delegate to the targetConnectionFactory
.- Since:
- 1.2
- Author:
- Juergen Hoeller
- See Also:
getConnection()
, Serialized Form
Constructor Summary
Constructors Constructor Description DelegatingConnectionFactory()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.Connection
getConnection()
Connection
getConnection(ConnectionSpec connectionSpec)
ResourceAdapterMetaData
getMetaData()
RecordFactory
getRecordFactory()
Reference
getReference()
ConnectionFactory
getTargetConnectionFactory()
Return the target ConnectionFactory that this ConnectionFactory should delegate to.void
setReference(Reference reference)
void
setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
Constructor Detail
DelegatingConnectionFactory
public DelegatingConnectionFactory()
Method Detail
setTargetConnectionFactory
public void setTargetConnectionFactory(ConnectionFactory targetConnectionFactory)
Set the target ConnectionFactory that this ConnectionFactory should delegate to.
getTargetConnectionFactory
public ConnectionFactory getTargetConnectionFactory()
Return the target ConnectionFactory that this ConnectionFactory should delegate to.
afterPropertiesSet
public void afterPropertiesSet()
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
getConnection
public Connection getConnection() throws ResourceException
- Specified by:
getConnection
in interfaceConnectionFactory
- Throws:
ResourceException
getConnection
public Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException
- Specified by:
getConnection
in interfaceConnectionFactory
- Throws:
ResourceException
getRecordFactory
public RecordFactory getRecordFactory() throws ResourceException
- Specified by:
getRecordFactory
in interfaceConnectionFactory
- Throws:
ResourceException
getMetaData
public ResourceAdapterMetaData getMetaData() throws ResourceException
- Specified by:
getMetaData
in interfaceConnectionFactory
- Throws:
ResourceException
getReference
public Reference getReference() throws NamingException
- Specified by:
getReference
in interfaceReferenceable
- Throws:
NamingException
setReference
public void setReference(Reference reference)
- Specified by:
setReference
in interfaceReferenceable