Search in sources :

Example 1 with ApplicationTemplateDAOImpl

use of org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationTemplateDAOImpl in project carbon-identity-framework by wso2.

the class ApplicationMgtSystemConfig method getApplicationTemplateDAO.

/**
 * Return an instance of the ApplicationDAO
 *
 * @return
 */
public ApplicationTemplateDAO getApplicationTemplateDAO() {
    ApplicationTemplateDAO applicationTemplateDAO = null;
    if (appTemplateDAOClassName != null) {
        try {
            // Bundle class loader will cache the loaded class and returned
            // the already loaded instance, hence calling this method
            // multiple times doesn't cost.
            Class clazz = Class.forName(appTemplateDAOClassName);
            applicationTemplateDAO = (ApplicationTemplateDAO) clazz.newInstance();
        } catch (ClassNotFoundException e) {
            log.error("Error while instantiating the ApplicationTemplateDAO ", e);
        } catch (InstantiationException e) {
            log.error("Error while instantiating the ApplicationTemplateDAO ", e);
        } catch (IllegalAccessException e) {
            log.error("Error while instantiating the ApplicationTemplateDAO ", e);
        }
    } else {
        applicationTemplateDAO = new ApplicationTemplateDAOImpl();
    }
    return applicationTemplateDAO;
}
Also used : ApplicationTemplateDAOImpl(org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationTemplateDAOImpl) ApplicationTemplateDAO(org.wso2.carbon.identity.application.mgt.dao.ApplicationTemplateDAO)

Aggregations

ApplicationTemplateDAO (org.wso2.carbon.identity.application.mgt.dao.ApplicationTemplateDAO)1 ApplicationTemplateDAOImpl (org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationTemplateDAOImpl)1