|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jca.cci.core.support.CciDaoSupport
public abstract class CciDaoSupport
Convenient super class for CCI data access objects. Requires a ConnectionFactory to be set, providing a CciTemplate based on it to subclasses.
This base class is mainly intended for CciTemplate usage but can also be used when working with ConnectionFactoryUtils directly or with org.springframework.cci.object classes.
setConnectionFactory(javax.resource.cci.ConnectionFactory)
,
CciTemplate
,
ConnectionFactoryUtils
Field Summary | |
---|---|
protected Log |
logger
|
Constructor Summary | |
---|---|
CciDaoSupport()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
protected CciTemplate |
createCciTemplate(ConnectionFactory connectionFactory)
Create a CciTemplate for the given ConnectionFactory. |
CciTemplate |
getCciTemplate()
Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly. |
protected Connection |
getConnection()
Get a CCI Connection, either from the current transaction or a new one. |
ConnectionFactory |
getConnectionFactory()
Return the ConnectionFactory used by this DAO. |
protected void |
initDao()
Subclasses can override this for custom initialization behavior. |
protected void |
releaseConnection(Connection con)
Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread. |
void |
setCciTemplate(CciTemplate cciTemplate)
Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory. |
void |
setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to be used by this DAO. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public CciDaoSupport()
Method Detail |
---|
public final void setConnectionFactory(ConnectionFactory connectionFactory)
protected CciTemplate createCciTemplate(ConnectionFactory connectionFactory)
Can be overridden in subclasses to provide a CciTemplate instance with different configuration, or a custom CciTemplate subclass.
connectionFactory
- the CCI ConnectionFactory to create a CciTemplate for
setConnectionFactory(javax.resource.cci.ConnectionFactory)
public final ConnectionFactory getConnectionFactory()
public final void setCciTemplate(CciTemplate cciTemplate)
public final CciTemplate getCciTemplate()
public final void afterPropertiesSet() throws Exception
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
Exception
- in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails.protected void initDao() throws Exception
Exception
- if initialization failsprotected final Connection getConnection() throws CannotGetCciConnectionException
CannotGetCciConnectionException
- if the attempt to get a Connection failedConnectionFactoryUtils.getConnection(javax.resource.cci.ConnectionFactory)
protected final void releaseConnection(Connection con)
con
- Connection to closeConnectionFactoryUtils.releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |