Пример #1
0
 public MQManagedObject()
 {
     base.TrConstructor("@(#) lib/dotnet/pc/winnt/baseclasses/MQManagedObject.cs, dotnet, p000  1.5 10/04/08 06:22:56");
     this.objectType      = 0;
     this.qMgr            = null;
     this.objectHandle    = null;
     this.handleInq       = null;
     this.handleSet       = null;
     this.alternateUserId = "";
     this.objectName      = "";
     this.openOptions     = 0;
     this.closeOptions    = 0;
 }
Пример #2
0
        public virtual void Close()
        {
            uint method = 0xeb;

            this.TrEntry(method);
            int pCompCode = 0;
            int pReason   = 0;

            try
            {
                if (this.qMgr != null)
                {
                    if (((this.qMgr.IsConnected && (this.handleInq != null)) && ((this.handleInq.HOBJ != null) && (this.handleInq.HOBJ.Handle != 0))) && (-1 != this.handleInq.HOBJ.Handle))
                    {
                        this.qMgr.nmqiConnector.MQCLOSE(this.qMgr.hConn, this.handleInq, this.CloseOptions, out pCompCode, out pReason);
                        this.handleInq = null;
                        if (pCompCode != 0)
                        {
                            this.qMgr.CheckHConnHealth(pReason);
                            base.throwNewMQException(pCompCode, pReason);
                        }
                    }
                    if (((this.qMgr.IsConnected && (this.handleSet != null)) && ((this.handleSet.HOBJ != null) && (this.handleSet.HOBJ.Handle != 0))) && (-1 != this.handleSet.HOBJ.Handle))
                    {
                        this.qMgr.nmqiConnector.MQCLOSE(this.qMgr.hConn, this.handleSet, this.CloseOptions, out pCompCode, out pReason);
                        this.handleSet = null;
                        if (pCompCode != 0)
                        {
                            this.qMgr.CheckHConnHealth(pReason);
                            base.throwNewMQException(pCompCode, pReason);
                        }
                    }
                    this.isClosed = true;
                }
            }
            finally
            {
                base.TrExit(method);
            }
        }
Пример #3
0
        public void Inquire(int[] selectors, int[] intAttrs, byte[] charAttrs)
        {
            uint method = 0xed;

            this.TrEntry(method, new object[] { selectors, intAttrs, charAttrs });
            Hobj hOBJ      = null;
            int  pCompCode = 0;
            int  pReason   = 0;

            try
            {
                int length;
                int num3;
                if ((selectors == null) || (selectors.Length == 0))
                {
                    base.throwNewMQException(2, 0x813);
                }
                if (this.objectType == 5)
                {
                    if ((this.qMgr == null) || !this.qMgr.IsConnected)
                    {
                        base.throwNewMQException(2, 0x7e2);
                    }
                    if (this.isClosed)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    if (((this.handleInq == null) || (this.handleInq.HOBJ == null)) || (this.handleInq.HOBJ.Handle == 0))
                    {
                        this.handleInq = MQQueueManager.nmqiEnv.NewPhobj();
                        this.OpenForInquire();
                    }
                    hOBJ = this.handleInq.HOBJ;
                }
                if (this.objectType == 3)
                {
                    if ((this.qMgr == null) || !this.qMgr.IsConnected)
                    {
                        base.throwNewMQException(2, 0x7e2);
                    }
                    if (this.isClosed)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                if (this.objectType == 1)
                {
                    if (!this.IsOpen)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                if (this.objectType == 8)
                {
                    if (!this.IsOpen)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                if (intAttrs == null)
                {
                    length = 0;
                }
                else
                {
                    length = intAttrs.Length;
                }
                if (charAttrs == null)
                {
                    num3 = 0;
                }
                else
                {
                    num3 = charAttrs.Length;
                }
                this.qMgr.nmqiConnector.MQINQ(this.qMgr.hConn, hOBJ, selectors.Length, selectors, length, intAttrs, num3, charAttrs, out pCompCode, out pReason);
                if (pCompCode != 0)
                {
                    this.qMgr.CheckHConnHealth(pReason);
                    base.throwNewMQException(pCompCode, pReason);
                }
            }
            finally
            {
                base.TrExit(method);
            }
        }
Пример #4
0
        public void Set(int[] selectors, int[] intAttrs, byte[] charAttrs)
        {
            uint method = 0xec;

            this.TrEntry(method, new object[] { selectors, intAttrs, charAttrs });
            Hobj hOBJ           = null;
            int  selectorCount  = 0;
            int  intAttrCount   = 0;
            int  charAttrLength = 0;
            int  pCompCode      = 0;
            int  pReason        = 0;

            try
            {
                if ((selectors == null) || (selectors.Length == 0))
                {
                    base.throwNewMQException(2, 0x813);
                }
                if (5 == this.objectType)
                {
                    if (this.qMgr == null)
                    {
                        base.throwNewMQException(2, 0x7e2);
                    }
                    if (this.isClosed)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    if (((this.handleSet == null) || (this.handleSet.HOBJ == null)) || (this.handleSet.HOBJ.Handle == 0))
                    {
                        this.handleSet = MQQueueManager.nmqiEnv.NewPhobj();
                        this.OpenForSet();
                    }
                    hOBJ = this.handleSet.HOBJ;
                }
                if (this.objectHandle == null)
                {
                    this.objectHandle = MQQueueManager.nmqiEnv.NewPhobj();
                }
                if (1 == this.objectType)
                {
                    if (!this.IsOpen)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                if (8 == this.objectType)
                {
                    if (!this.IsOpen)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                if (3 == this.objectType)
                {
                    if (!this.IsOpen)
                    {
                        base.throwNewMQException(2, 0x7e3);
                    }
                    hOBJ = this.objectHandle.HOBJ;
                }
                selectorCount = selectors.Length;
                if (intAttrs != null)
                {
                    intAttrCount = intAttrs.Length;
                }
                if (charAttrs != null)
                {
                    charAttrLength = charAttrs.Length;
                }
                this.qMgr.nmqiConnector.MQSET(this.qMgr.hConn, hOBJ, selectorCount, selectors, intAttrCount, intAttrs, charAttrLength, charAttrs, out pCompCode, out pReason);
                if (pCompCode != 0)
                {
                    this.qMgr.CheckHConnHealth(pReason);
                    base.throwNewMQException(pCompCode, pReason);
                }
            }
            finally
            {
                base.TrExit(method);
            }
        }