private void loadConfig() { try { Configuration dbConfig = ConfigurationManager.getInstance().getConfig(IFrameworkConfig.FRAMEWORK_DATABASE_CONFIG); _useEntityBean = dbConfig.getBoolean(IFrameworkConfig.CMP_ON, true); } catch (Exception ex) { Log.error( ILogErrorCodes.CONFIGURATION_LOAD, Log.DB, "[MetaInfoFactory.loadConfig] Unable to load config. Setting cmp.on to true. Unexpected error: " + ex.getMessage(), ex); } }
private static void dumpFailedJMS( String destType, Hashtable<String, String> configProps, String destName, Serializable msgObj, Hashtable msgProps) throws Exception { JMSFailedMsg failedMsg = new JMSFailedMsg(destType, configProps, destName, msgObj, msgProps); // use DB try { Log.debug(Log.FRAMEWORK, "Persist failed jms to DB. Failed JMS: " + failedMsg); JMSFailedMsgHelper helper = JMSFailedMsgHelper.getInstance(); helper.persistFailedJMSMsg(failedMsg); } catch (Exception ex) { Log.error("", Log.FRAMEWORK, "Failed to persist the failed jms to DB.", ex); throw ex; } }
/** * Load the EntityMetaInfo from the database and cache it. * * @param objectName Full qualified class name of the Entity to load EntityMetaInfo for. */ private EntityMetaInfo loadEntityMetaInfoByObjectName(String objectName) { EntityMetaInfo emi = null; try { if (_useEntityBean) { emi = getEntityMetaInfoHome().findByPrimaryKey(objectName).getData(); } else { emi = getMetaInfoObj().findByObjectName(objectName); } addEntityMetaInfo(emi); } catch (Throwable t) { Log.error( ILogErrorCodes.ENTITY_META_INFO_READ, Log.DB, "[MetaInfoFactory.loadEntityMetaInfoByObjectName] Error ", t); } return emi; }
/** * Retrieve the fieldmetainfos with the specified label * * @param label The label * @return Collection of FieldMetaInfo objects found. */ public Collection getFieldMetaInfoByLabel(String label) { Collection fmi = null; try { if (_useEntityBean) { Collection results = getFieldMetaInfoHome().findByLabel(label); fmi = new ArrayList(); for (Iterator i = results.iterator(); i.hasNext(); ) { fmi.add(((IFieldMetaInfoLocalObj) i.next()).getData()); } } else { fmi = getMetaInfoObj().findFieldMetaInfoByLabel(label); } } catch (Exception ex) { Log.error( ILogErrorCodes.FIELD_META_INFO_RETRIEVE, Log.DB, "[MetaInfoFactory.getFieldMetaInfoByLabel] Error ", ex); } return fmi; }
/** * Log an error message with the specified error code and <code>Throwable</code> object of origin * * @see com.gridnode.pdip.app.mapper.exception.ILogErrorCodes * @param errorCode The error code * @param msg The error message * @param t The <code>Throwable</code> object of origin */ public static void error(String errorCode, String msg, Throwable t) { Log.error(errorCode, CATEGORY, msg, t); }
/** * Log an error message with the specified error code * * @see com.gridnode.pdip.app.mapper.exception.ILogErrorCodes * @param errorCode * @param msg */ public static void error(String errorCode, Object msg) { Log.error(errorCode, CATEGORY, msg); }