getDefaultEventQueue() 공개 정적인 메소드

public static getDefaultEventQueue ( Wombat.MamaBridge bridgeImpl ) : Wombat.MamaQueue
bridgeImpl Wombat.MamaBridge
리턴 Wombat.MamaQueue
예제 #1
0
        private MamaSubscriberCS(string[] args)
        {
            try
            {
                if (parseCommandLine(args))
                {
                    mamaBridge = Mama.loadBridge(middlewareName);

                    Mama.open();

                    mamaTransport = new MamaTransport();
                    mamaTransport.setTransportCallback(this);
                    mamaTransport.create(transportName, mamaBridge);

                    mamaDefaultQueue = Mama.getDefaultEventQueue(mamaBridge);

                    mamaSubscription = new MamaSubscription();
                    mamaSubscription.createBasic(
                        mamaTransport,
                        mamaDefaultQueue,
                        this,   // callback
                        topicName);

                    Console.WriteLine("Starting mama...");
                    Mama.start(mamaBridge);

                    // Prevent over-enthusiastic GC from reclaiming transport object
                    GC.KeepAlive(mamaTransport);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #2
0
        private void createSubscriber(MamaBridge bridge)
        {
            MamaSubscription mamaSubscription = new MamaSubscription();
            MamaTransport    mamaTransport    = new MamaTransport();
            MamaQueue        mamaDefaultQueue = Mama.getDefaultEventQueue(bridge);
            Dispatcher       dispatcher       = new Dispatcher(bridge);

            mamaTransport = new MamaTransport();
            mamaTransport.setTransportCallback(this);
            mamaTransport.create(transportName, bridge);

            mamaSubscription = new MamaSubscription();
            mamaSubscription.createBasic(
                mamaTransport,
                mamaDefaultQueue,
                this,                   // callback
                topicName);

            Console.WriteLine("Starting mama...");

            mamaSubscriptions.Add(mamaSubscription);
            mamaTransports.Add(mamaTransport);

            Thread startThread = new Thread(new ThreadStart(dispatcher.dispatch));

            startThread.Start();
        }
예제 #3
0
        public int Run()
        {
            ParseArgs();
            if (helpNeeded)
            {
                DisplayUsage();
                return(0);
            }

            Mama.logToFile(@"mama.log", MamaLogLevel.MAMA_LOG_LEVEL_FINEST);
            bridge = Mama.loadBridge(middlewareName);
            Mama.open();
            MamaTransport    transport    = new MamaTransport();
            MamaQueue        defaultQueue = Mama.getDefaultEventQueue(bridge);
            MamaTimer        timer        = new MamaTimer();
            MamaSubscription subscription = new MamaSubscription();
            MamaPublisherCS  publisher    = this;

            transport.create(transportName, bridge);
            timer.create(defaultQueue, publisher, interval, null);
            subscription.createBasic(transport, defaultQueue, publisher, inboundTopic);
            publisher.create(transport, outboundTopic);
            msg = new MamaMsg();

            Mama.start(bridge);
            Mama.close();
            return(0);
        }
예제 #4
0
 public void init()
 {
     myDefaultQueue = Mama.getDefaultEventQueue(myBridge);
     myTimer.create(myDefaultQueue, this, 2.0, null);               // two seconds
     myFtMember.create();
     myFtMember.setup(myDefaultQueue, this, myTransport, myGroup, myWeight, 1.0, 6.0, null);
     myFtMember.activate();
 }
예제 #5
0
        public int Run()
        {
            ParseArgs();
            if (helpNeeded)
            {
                DisplayUsage();
                return(0);
            }

            Mama.logToFile(@"mama.log", MamaLogLevel.MAMA_LOG_LEVEL_NORMAL);

            bridge = Mama.loadBridge(middlewareName);

            Mama.open();

            MamaQueue defaultQueue = Mama.getDefaultEventQueue(bridge);

            msg = new MamaMsg();

            MamaTimer timer = new MamaTimer();

            timer.create(defaultQueue, this, interval, null);

            queueGroup = new MamaQueueGroup(bridge, 1);

            MamaTransport transport = new MamaTransport();

            transport.create(transportName, bridge);

            MamaSubscription subscription = null;

            if (nosub == false)
            {
                subscription = new MamaSubscription();
                subscription.createBasic(transport, defaultQueue, this, inboundTopic);
            }

            publisher = new MamaPublisher();
            if (pubCb)
            {
                publisher.createWithCallbacks(transport, queueGroup.getNextQueue(), this, null, outboundTopic, null, null);
            }
            else
            {
                publisher.create(transport, outboundTopic);
            }

            Mama.start(bridge);

            Mama.close();

            return(0);
        }
예제 #6
0
 private void InitializeMama()
 {
     try
     {
         Mama.logToFile(@"mama.log", MamaLogLevel.MAMA_LOG_LEVEL_FINEST);
         bridge = Mama.loadBridge(middleware);
         Mama.open();
         defaultQueue = Mama.getDefaultEventQueue(bridge);
     }
     catch (MamaException e)
     {
         Console.WriteLine("Error initializing mama: {0}", e.ToString());
         Exit(1);
     }
 }
예제 #7
0
 private void InitializeMama()
 {
     try
     {
         Mama.logToFile(@"mama.log", MamaLogLevel.MAMA_LOG_LEVEL_FINEST);
         bridge = new MamaBridge(middlewareName);
         Mama.open();
         transport = new MamaTransport();
         transport.create(transportName, bridge);
         defaultQueue = Mama.getDefaultEventQueue(bridge);
     }
     catch (MamaException e)
     {
         Console.WriteLine("Error initializing mama or creating transport: {0}", e.ToString());
         Exit(1);
     }
 }