Esempio n. 1
0
    static void Main(String[] args)
    {
        LBMContext ctx = null;           /* Context object: container for UM "instance". */
                LBMReceiver rcv = null;          /* Receiver object: for receiving messages. */
                LBMTopic rtopic = null;          /* Topic object */
                LBMReceiverAttributes rcv_attr;  /* Receiver attribute object */

                /* Initialize and create receiver and receiver callback */
                LBMReceiverCallback myReceiverCallback = new LBMReceiverCallback(onReceive);

                /*** Initialization: create necessary UM objects. ***/
                ctx = new LBMContext();
                rcv_attr = new LBMReceiverAttributes();

                UMERcvRecInfo umerecinfocb = new UMERcvRecInfo();
                rcv_attr.setRecoverySequenceNumberCallback(umerecinfocb.setRecoverySequenceNumberInfo, null);

                rtopic = new LBMTopic(ctx, "test.topic", rcv_attr);
                rcv = new LBMReceiver(ctx, rtopic, myReceiverCallback, null);

                while(true)
                {

                }
    }
Esempio n. 2
0
    static void Main(String[] args)
    {
        LBMContext            ctx    = null;     /* Context object: container for UM "instance". */
        LBMReceiver           rcv    = null;     /* Receiver object: for receiving messages. */
        LBMTopic              rtopic = null;     /* Topic object */
        LBMReceiverAttributes rcv_attr;          /* Receiver attribute object */

        /* Initialize and create receiver and receiver callback */
        LBMReceiverCallback myReceiverCallback = new LBMReceiverCallback(onReceive);

        /*** Initialization: create necessary UM objects. ***/
        ctx      = new LBMContext();
        rcv_attr = new LBMReceiverAttributes();

        UMERcvRecInfo umerecinfocb = new UMERcvRecInfo();

        rcv_attr.setRecoverySequenceNumberCallback(umerecinfocb.setRecoverySequenceNumberInfo, null);

        rtopic = new LBMTopic(ctx, "test.topic", rcv_attr);
        rcv    = new LBMReceiver(ctx, rtopic, myReceiverCallback, null);

        while (true)
        {
        }
    }     /* main */