예제 #1
0
        internal void UpdateHconn(NmqiMQ mqInstance, Phconn phconn)
        {
            uint method = 0x2f9;

            this.TrEntry(method, new object[] { mqInstance, phconn });
            try
            {
                this.MQI = mqInstance;
                Hconn hconn = null;
                switch (this.value_)
                {
                case -1:
                    hconn = new HconnAdapter(-1);
                    break;

                case 0:
                    hconn = new HconnAdapter(0);
                    break;

                default:
                    hconn = this;
                    if (this.qMgrInfo == null)
                    {
                        this.qMgrInfo = NmqiTools.GetQueueManagerInfo(base.env, mqInstance, this);
                    }
                    break;
                }
                phconn.HConn = hconn;
            }
            finally
            {
                base.TrExit(method);
            }
        }
예제 #2
0
        public QueueManagerInfo NewQueueManagerInfo()
        {
            uint method = 0x3c9;

            this.TrEntry(method);
            QueueManagerInfo result = new QueueManagerInfo(this);

            base.TrExit(method, result);
            return(result);
        }
예제 #3
0
        private void LoadInfo()
        {
            uint method = 0x630;

            this.TrEntry(method);
            try
            {
                if (this.info == null)
                {
                    this.info = NmqiTools.GetQueueManagerInfo(base.env, this.MQFap, this.hconn);
                }
            }
            finally
            {
                base.TrExit(method);
            }
        }
예제 #4
0
        public static QueueManagerInfo GetQueueManagerInfo(NmqiEnvironment env, NmqiMQ mq, Hconn hconn)
        {
            QueueManagerInfo   info     = env.NewQueueManagerInfo();
            MQObjectDescriptor pObjDesc = env.NewMQOD();

            pObjDesc.ObjectType = 5;
            int   options   = 0x20;
            Phobj pHobj     = env.NewPhobj();
            int   pCompCode = 0;
            int   pReason   = 0;

            mq.MQOPEN(hconn, ref pObjDesc, options, pHobj, out pCompCode, out pReason);
            if (pReason == 0)
            {
                Hobj   hOBJ       = pHobj.HOBJ;
                int[]  pSelectors = new int[] { 0x1f, 0x20, 2, 0x7df, 0x7f0 };
                int[]  pIntAttrs  = new int[3];
                byte[] pCharAttrs = new byte[0x60];
                mq.MQINQ(hconn, hOBJ, pSelectors.Length, pSelectors, pIntAttrs.Length, pIntAttrs, pCharAttrs.Length, pCharAttrs, out pCompCode, out pReason);
                if (pReason == 0)
                {
                    info.CommandLevel = pIntAttrs[0];
                    info.Platform     = pIntAttrs[1];
                    info.Ccsid        = pIntAttrs[2];
                    Encoding dotnetEncoding = MQCcsidTable.GetDotnetEncoding(info.Ccsid);
                    info.Name = dotnetEncoding.GetString(pCharAttrs, 0, 0x30);
                    info.Uid  = dotnetEncoding.GetString(pCharAttrs, 0x30, 0x30);
                }
                else
                {
                    NmqiException exception = new NmqiException(env, 0x253a, null, pCompCode, pReason, null);
                    env.LastException = exception;
                    throw exception;
                }
                mq.MQCLOSE(hconn, pHobj, 0, out pCompCode, out pReason);
                return(info);
            }
            NmqiException exception2 = new NmqiException(env, 0x2525, null, pCompCode, pReason, null);

            env.LastException = exception2;
            throw exception2;
        }