コード例 #1
0
 public void onSecurityStatusRecap(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusRecap recap)
 {
     prettyPrint("SecStatus recap ({0} - {1})", subscription.getSymbol(), recap.getSecurityStatusStr());
 }
コード例 #2
0
 public void onSecurityStatusUpdate(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusUpdate update,
     MamdaSecurityStatusRecap recap)
 {
     prettyPrint("SecStatus update ({0} - {1}", subscription.getSymbol(), listener.getSecurityStatusStr());
 }
コード例 #3
0
 public void onSecurityStatusRecap(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusRecap recap)
 {
     Console.WriteLine("SecStatus recap (" + subscription.getSymbol()
                       + "    Status:" + recap.getSecurityStatusStr());
 }
 public void testNotInEffect()
 {
     mSecStatusListener = new MamdaSecurityStatusListener();
     mSubscription.addMsgListener(mSecStatusListener);
     mMsg = new MamaMsg();
     addMamaHeaderFields(mMsg,
                         (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS,
                         (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK,
                         (uint)1);
     callMamdaOnMsg(mSubscription, mMsg);
     Assert.AreEqual(' ', mSecStatusListener.getShortSaleCircuitBreaker());
     Assert.AreEqual(MamdaFieldState.NOT_INITIALISED,
                     mSecStatusListener.getShortSaleCircuitBreakerFieldState());
     mMsg = null;
     mSecStatusListener = null;
 }
        public void testCached()
        {
            mSecStatusListener = new MamdaSecurityStatusListener();
            mSubscription.addMsgListener(mSecStatusListener);

            mMsg = new MamaMsg();
            addMamaHeaderFields(mMsg,
                                (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS,
                                (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK,
                                (uint)1);
            mMsg.addChar(null, 5248, 'A');
            callMamdaOnMsg(mSubscription, mMsg);
            Assert.AreEqual('A', mSecStatusListener.getShortSaleCircuitBreaker());
            Assert.AreEqual(MamdaFieldState.MODIFIED,
                            mSecStatusListener.getShortSaleCircuitBreakerFieldState());
            mMsg = null;
            mSecStatusListener = null;
        }
コード例 #6
0
ファイル: MamdaSecStatusTicker.cs プロジェクト: jacobraj/MAMA
        public static void Main(string[] args)
        {
            MamaTransport        transport          = null;
            MamaTransport        dictTransport      = null;
            string               dictTransportName  = null;
            MamaQueue            defaultQueue       = null;
            MamaDictionary       dictionary         = null;
            CommandLineProcessor options            = new CommandLineProcessor(args);

            if (options.hasLogLevel())
            {
                Mama.enableLogging(options.getLogLevel());
            }

            try
            {
                // Initialize MAMDA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport = new MamaTransport();
                myMamaSource = new MamaSource ();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);

                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = "WOMBAT";
                dictTransportName = options.getDictTransport();
                if (null != dictTransportName)
                {
                    dictTransport = new MamaTransport();
                    dictTransport.create(dictTransportName, myBridge);
                }
                else
                {
                    dictTransport = transport;
                }
                dictionarySource.transport = dictTransport;

                /*Get the data dictionary*/
                dictionary = buildDataDictionary(dictTransport, defaultQueue, dictionarySource);

                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    MamdaSubscription  aSubscription =  new MamdaSubscription();
                    MamdaSecurityStatusListener aSecListener = new MamdaSecurityStatusListener();
                    SecTicker        aTicker        = new SecTicker();

                    aSecListener.addHandler(aTicker);
                    aSubscription.addMsgListener(aSecListener);

                    aSubscription.create(transport,
                                        defaultQueue,
                                        options.getSource (),
                                        symbol,
                                        null);
                }

                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);
            }
        }
コード例 #7
0
ファイル: MamdaSecStatusTicker.cs プロジェクト: jacobraj/MAMA
 public void onSecurityStatusUpdate(
     MamdaSubscription            subscription,
     MamdaSecurityStatusListener  listener,
     MamaMsg                      msg,
     MamdaSecurityStatusUpdate    update,
     MamdaSecurityStatusRecap     recap)
 {
     Console.WriteLine ("SecStatus update (" + subscription.getSymbol ()
      + "    Status:" + listener.getSecurityStatusStr ());
 }
コード例 #8
0
        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())
            {
                myLogLevel = options.getLogLevel();
                Mama.enableLogging(myLogLevel);
            }

            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 = options.getDictSource();
                dictionarySource.transport       = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaQuoteFields.setDictionary(dictionary, null);
                MamdaTradeFields.setDictionary(dictionary, null);
                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count];
                int i = 0;
                foreach (string symbol in options.getSymbolList())
                {
                    mamdaSubscriptions[i] = new MamdaSubscription();

                    MamdaTradeListener          aTradeListener          = new MamdaTradeListener();
                    MamdaQuoteListener          aQuoteListener          = new MamdaQuoteListener();
                    MamdaSecurityStatusListener aSecurityStatusListener = new MamdaSecurityStatusListener();
                    ComboTicker aTicker = new ComboTicker();

                    aTradeListener.addHandler(aTicker);
                    aQuoteListener.addHandler(aTicker);
                    aSecurityStatusListener.addHandler(aTicker);
                    mamdaSubscriptions[i].addMsgListener(aTradeListener);
                    mamdaSubscriptions[i].addMsgListener(aQuoteListener);
                    mamdaSubscriptions[i].addStaleListener(aTicker);
                    mamdaSubscriptions[i].addErrorListener(aTicker);

                    mamdaSubscriptions[i].create(transport,
                                                 defaultQueue,
                                                 options.getSource(),
                                                 symbol,
                                                 null /*Closure*/);

                    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);
            }
        }
コード例 #9
0
        public static void Main(string[] args)
        {
            MamaTransport        transport         = null;
            MamaTransport        dictTransport     = null;
            string               dictTransportName = null;
            MamaQueue            defaultQueue      = null;
            MamaDictionary       dictionary        = null;
            CommandLineProcessor options           = new CommandLineProcessor(args);

            if (options.hasLogLevel())
            {
                Mama.enableLogging(options.getLogLevel());
            }

            try
            {
                // Initialize MAMDA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport    = new MamaTransport();
                myMamaSource = new MamaSource();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);

                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = "WOMBAT";
                dictTransportName = options.getDictTransport();
                if (null != dictTransportName)
                {
                    dictTransport = new MamaTransport();
                    dictTransport.create(dictTransportName, myBridge);
                }
                else
                {
                    dictTransport = transport;
                }
                dictionarySource.transport = dictTransport;

                /*Get the data dictionary*/
                dictionary = buildDataDictionary(dictTransport, defaultQueue, dictionarySource);

                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    MamdaSubscription           aSubscription = new MamdaSubscription();
                    MamdaSecurityStatusListener aSecListener  = new MamdaSecurityStatusListener();
                    SecTicker aTicker = new SecTicker();

                    aSecListener.addHandler(aTicker);
                    aSubscription.addMsgListener(aSecListener);

                    aSubscription.create(transport,
                                         defaultQueue,
                                         options.getSource(),
                                         symbol,
                                         null);
                }

                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);
            }
        }
コード例 #10
0
ファイル: MamdaComboTicker.cs プロジェクト: jacobraj/MAMA
        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())
            {
                myLogLevel = options.getLogLevel();
                Mama.enableLogging(myLogLevel);
            }

            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 = options.getDictSource();
                dictionarySource.transport = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaQuoteFields.setDictionary(dictionary, null);
                MamdaTradeFields.setDictionary(dictionary, null);
                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count];
                int i=0;
                foreach (string symbol in options.getSymbolList())
                {
                    mamdaSubscriptions[i] =  new MamdaSubscription();

                    MamdaTradeListener aTradeListener = new MamdaTradeListener();
                    MamdaQuoteListener aQuoteListener = new MamdaQuoteListener();
                    MamdaSecurityStatusListener aSecurityStatusListener = new MamdaSecurityStatusListener();
                    ComboTicker        aTicker        = new ComboTicker();

                    aTradeListener.addHandler(aTicker);
                    aQuoteListener.addHandler(aTicker);
                    aSecurityStatusListener.addHandler(aTicker);
                    mamdaSubscriptions[i].addMsgListener(aTradeListener);
                    mamdaSubscriptions[i].addMsgListener(aQuoteListener);
                    mamdaSubscriptions[i].addStaleListener(aTicker);
                    mamdaSubscriptions[i].addErrorListener(aTicker);

                    mamdaSubscriptions[i].create(transport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null/*Closure*/);

                    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);
            }
        }
コード例 #11
0
ファイル: MamdaComboTicker.cs プロジェクト: jacobraj/MAMA
            public void onSecurityStatusUpdate(
				MamdaSubscription            subscription,
				MamdaSecurityStatusListener  listener,
				MamaMsg                      msg,
				MamdaSecurityStatusUpdate    update,
				MamdaSecurityStatusRecap     recap)
            {
                prettyPrint("SecStatus update ({0} - {1}", subscription.getSymbol (), listener.getSecurityStatusStr ());
            }
コード例 #12
0
ファイル: MamdaComboTicker.cs プロジェクト: jacobraj/MAMA
            public void onSecurityStatusRecap(
				MamdaSubscription            subscription,
				MamdaSecurityStatusListener  listener,
				MamaMsg                      msg,
				MamdaSecurityStatusRecap     recap)
            {
                prettyPrint("SecStatus recap ({0} - {1})", subscription.getSymbol(), recap.getSecurityStatusStr ());
            }