/* Global dictionary, read only once: * com.reuters.tibmsg.TibException: Specified data dictionary has already been loaded/unpacked */ static { Context.initialize(); dictionary = FieldDictionary.create(); FieldDictionary.readRDMFieldDictionary(dictionary, "RDMFieldDictionary"); FieldDictionary.readEnumTypeDef(dictionary, "enumtype.def"); biddef = dictionary.getFidDef("BID"); askdef = dictionary.getFidDef("ASK"); }
/** * This method should be called one before parsing and data. * * @param fieldDictionaryFilename * @param enumDictionaryFilename * @throws DictionaryException if an error has occurred */ public static void initializeDictionary( String fieldDictionaryFilename, String enumDictionaryFilename) throws DictionaryException { FieldDictionary dictionary = FieldDictionary.create(); try { FieldDictionary.readRDMFieldDictionary(dictionary, fieldDictionaryFilename); System.out.println("field dictionary read from RDMFieldDictionary file"); FieldDictionary.readEnumTypeDef(dictionary, enumDictionaryFilename); System.out.println("enum dictionary read from enumtype.def file"); initializeDictionary(dictionary); } catch (DictionaryException e) { throw new DictionaryException( "ERROR: Check if files " + fieldDictionaryFilename + " and " + enumDictionaryFilename + " exist and are readable.", e); } }