public void SetUp() { try { MamaBridge mBridge = Mama.loadBridge("lbm"); Mama.open(); MamaDictionary mDictionary = new MamaDictionary(); mDictionary.create("dictionary.txt"); MamdaCommonFields.setDictionary(mDictionary, null); MamdaQuoteFields.reset(); MamdaQuoteFields.setDictionary(mDictionary, null); mSubscription = new MamdaSubscription(); mQuoteListener = new MamdaQuoteListener(); mSubscription.addMsgListener(mQuoteListener); ticker = new QuoteTicker(); mQuoteListener.addHandler(ticker); } catch (Exception ex) { throw new MamdaDataException(ex.Message, ex); } }
public void SetUp() { try { MamaBridge mBridge = Mama.loadBridge("lbm"); Mama.open(); MamaDictionary mDictionary = new MamaDictionary(); mDictionary.create("dictionary.txt"); MamdaCommonFields.setDictionary(mDictionary, null); MamdaQuoteFields.reset(); MamdaQuoteFields.setDictionary(mDictionary, null); mSubscription = new MamdaSubscription(); mQuoteListener = new MamdaQuoteListener(); mSubscription.addMsgListener(mQuoteListener); ticker = new QuoteTicker(); mQuoteListener.addHandler(ticker); } catch (Exception ex) { throw new MamdaDataException(ex.Message, ex); } }
public static void Main(string[] args) { MamaTransport transport = null; MamaQueue defaultQueue = null; MamaDictionary dictionary = null; CommandLineProcessor options = new CommandLineProcessor(args); myQuietModeLevel = options.getQuietModeLevel(); if (options.hasLogLevel()) { Mama.enableLogging(options.getLogLevel()); } try { // Initialize MAMDA myBridge = new MamaBridge(options.getMiddleware()); Mama.open(); transport = new MamaTransport(); transport.create(options.getTransport(), myBridge); defaultQueue = Mama.getDefaultEventQueue(myBridge); /*Get the data dictionary*/ MamaSource dictionarySource = new MamaSource(); dictionarySource.symbolNamespace = "WOMBAT"; dictionarySource.transport = transport; dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource); MamdaQuoteFields.setDictionary(dictionary, null); mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count]; int i = 0; foreach (string symbol in options.getSymbolList()) { mamdaSubscriptions[i] = new MamdaSubscription(); MamdaQuoteListener aQuoteListener = new MamdaQuoteListener(); QuoteTicker aTicker = new QuoteTicker(); aQuoteListener.addHandler(aTicker); mamdaSubscriptions[i].addMsgListener(aQuoteListener); mamdaSubscriptions[i].addStaleListener(aTicker); mamdaSubscriptions[i].addErrorListener(aTicker); mamdaSubscriptions[i].create(transport, defaultQueue, options.getSource(), symbol, null); i++; } Console.WriteLine("Hit Enter or Ctrl-C to exit."); Mama.start(myBridge); GC.KeepAlive(dictionary); Console.ReadLine(); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); Environment.Exit(1); } }
public static void Main(string[] args) { MamaTransport transport = null; MamaQueue defaultQueue = null; MamaDictionary dictionary = null; CommandLineProcessor options = new CommandLineProcessor(args); myQuietModeLevel = options.getQuietModeLevel(); if (options.hasLogLevel()) { Mama.enableLogging(options.getLogLevel()); } try { // Initialize MAMDA myBridge = new MamaBridge(options.getMiddleware()); Mama.open(); transport = new MamaTransport(); transport.create(options.getTransport(), myBridge); defaultQueue = Mama.getDefaultEventQueue(myBridge); /*Get the data dictionary*/ MamaSource dictionarySource = new MamaSource(); dictionarySource.symbolNamespace = "WOMBAT"; dictionarySource.transport = transport; dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource); MamdaQuoteFields.setDictionary(dictionary, null); mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count]; int i=0; foreach (string symbol in options.getSymbolList()) { mamdaSubscriptions[i] = new MamdaSubscription(); MamdaQuoteListener aQuoteListener = new MamdaQuoteListener(); QuoteTicker aTicker = new QuoteTicker(); aQuoteListener.addHandler(aTicker); mamdaSubscriptions[i].addMsgListener(aQuoteListener); mamdaSubscriptions[i].addStaleListener(aTicker); mamdaSubscriptions[i].addErrorListener(aTicker); mamdaSubscriptions[i].create(transport, defaultQueue, options.getSource (), symbol, null); i++; } Console.WriteLine("Hit Enter or Ctrl-C to exit."); Mama.start(myBridge); GC.KeepAlive(dictionary); Console.ReadLine(); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); Environment.Exit(1); } }