Search in sources :

Example 1 with LegacyAuditLookupValuesDao

use of org.mifos.framework.components.audit.persistence.LegacyAuditLookupValuesDao in project head by mifos.

the class AuditConfiguration method callMethodToCreateValueMap.

//FIXME I use reflect for invoking methods of Dao (Not type safe)
private Map<String, String> callMethodToCreateValueMap(String methodName, Short localeId) throws SystemException {
    valueMap = new HashMap<String, String>();
    Method[] methods = LegacyAuditLookupValuesDao.class.getMethods();
    for (Method method : methods) {
        if (method.getName().equalsIgnoreCase(methodName)) {
            try {
                LegacyAuditLookupValuesDao legacyAuditLookupValuesDao = ApplicationContextProvider.getBean(LegacyAuditLookupValuesDao.class);
                valueMap = (Map<String, String>) method.invoke(legacyAuditLookupValuesDao, new Object[] { localeId });
            } catch (Exception e) {
                throw new SystemException(e);
            }
        }
    }
    return valueMap;
}
Also used : SystemException(org.mifos.framework.exceptions.SystemException) Method(java.lang.reflect.Method) LegacyAuditLookupValuesDao(org.mifos.framework.components.audit.persistence.LegacyAuditLookupValuesDao) SystemException(org.mifos.framework.exceptions.SystemException)

Aggregations

Method (java.lang.reflect.Method)1 LegacyAuditLookupValuesDao (org.mifos.framework.components.audit.persistence.LegacyAuditLookupValuesDao)1 SystemException (org.mifos.framework.exceptions.SystemException)1