Search in sources :

Example 1 with HumanTaskDAOConnectionFactoryJDBC

use of org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnectionFactoryJDBC in project carbon-business-process by wso2.

the class Database method createDAOConnectionFactory.

/**
 * Creates the DAO connection factory.
 * @return : the connection factory.
 * @throws DatabaseConfigurationException : If the provided config factory cannot be instantiated.
 */
public HumanTaskDAOConnectionFactoryJDBC createDAOConnectionFactory() throws DatabaseConfigurationException {
    String connectionFactoryClassName = serverConfiguration.getDaoConnectionFactoryClass();
    if (log.isDebugEnabled()) {
        log.debug("Using DAO connection factory class: " + connectionFactoryClassName);
    }
    HumanTaskDAOConnectionFactoryJDBC humanTaskDAOConnectionFactoryJDBC;
    try {
        humanTaskDAOConnectionFactoryJDBC = (HumanTaskDAOConnectionFactoryJDBC) Class.forName(connectionFactoryClassName).newInstance();
    } catch (Exception ex) {
        String errMsg = "Human Task DAO Connection Factory instantiation failed!";
        log.error(errMsg);
        throw new DatabaseConfigurationException(errMsg, ex);
    }
    humanTaskDAOConnectionFactoryJDBC.setDataSource(getDataSource());
    humanTaskDAOConnectionFactoryJDBC.setTransactionManager(getTnxManager());
    humanTaskDAOConnectionFactoryJDBC.setDAOConnectionFactoryProperties(getGenericDAOFactoryProperties());
    humanTaskDAOConnectionFactoryJDBC.init();
    return humanTaskDAOConnectionFactoryJDBC;
}
Also used : HumanTaskDAOConnectionFactoryJDBC(org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnectionFactoryJDBC) HumanTaskServerException(org.wso2.carbon.humantask.core.engine.HumanTaskServerException)

Aggregations

HumanTaskDAOConnectionFactoryJDBC (org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnectionFactoryJDBC)1 HumanTaskServerException (org.wso2.carbon.humantask.core.engine.HumanTaskServerException)1