コード例 #1
0
        public MQSession GetSession(int connectOptions, MQSSLConfigOptions sslConfigOptions, MQConnectionSecurityParameters mqcsp, MQChannelDefinition mqcd, string qMgrName, int nmqiFlags, string uidFlowUserid, string uidFlowPassword, int ccsid, int maxFapLevel)
        {
            uint method = 0x5e7;

            this.TrEntry(method, new object[] { connectOptions, mqcsp, mqcd, qMgrName, nmqiFlags, uidFlowUserid, (uidFlowPassword == null) ? uidFlowPassword : "******", ccsid, maxFapLevel });
            MQSession session = null;

            try
            {
                MQConnectionSpecification specification = new MQConnectionSpecification(base.env, this, mqcd, sslConfigOptions, nmqiFlags, uidFlowUserid, uidFlowPassword, ccsid);
                try
                {
                    this.callSync.Acquire();
                    object obj2 = null;
                    foreach (object obj3 in this.allConnectionSpecs.Keys)
                    {
                        MQConnectionSpecification specification2 = (MQConnectionSpecification)obj3;
                        if (specification2.Equals(specification))
                        {
                            specification = specification2;
                            obj2          = specification2;
                            base.TrText(method, "Found a matching connection spec..");
                            break;
                        }
                    }
                    if (obj2 == null)
                    {
                        base.TrText(method, "Couldnt find a matching connection spec. Adding new one into table");
                        this.allConnectionSpecs.Add(specification, specification);
                    }
                }
                finally
                {
                    this.callSync.Release();
                }
                session = specification.GetSession(mqcd, sslConfigOptions, mqcsp, this.fap, qMgrName, connectOptions, maxFapLevel);
                try
                {
                    this.callSync.Acquire();
                    if (!this.allConnectionSpecs.ContainsKey(specification))
                    {
                        this.allConnectionSpecs.Add(specification, specification);
                    }
                }
                finally
                {
                    this.callSync.Release();
                }
            }
            finally
            {
                base.TrExit(method);
            }
            return(session);
        }
コード例 #2
0
        public override bool Equals(object other)
        {
            uint method = 0x596;

            this.TrEntry(method, new object[] { other });
            if (!(other is MQConnectionSpecification))
            {
                base.TrExit(method, false, 1);
                return(false);
            }
            MQConnectionSpecification specification = (MQConnectionSpecification)other;
            bool result = specification.mqcd.Equals(this.mqcd) && ((specification.mqsco != null) ? specification.mqsco.Equals(this.mqsco) : (((specification.nmqiFlags.Equals(this.nmqiFlags) && object.Equals(specification.uidFlowUserId, this.uidFlowUserId)) && object.Equals(specification.uidFlowPassword, this.uidFlowPassword)) && (specification.ccsid == this.ccsid)));

            base.TrText(method, "Return value from  Equals - " + result.ToString());
            base.TrExit(method, result, 2);
            return(result);
        }
コード例 #3
0
        internal void RemoveSpec(MQConnectionSpecification connectionSpec)
        {
            uint method = 0x5e8;

            this.TrEntry(method, new object[] { connectionSpec });
            try
            {
                this.callSync.Acquire();
                this.allConnectionSpecs.Remove(connectionSpec);
                base.TrText(method, "Connection spec has been removed from table..");
            }
            finally
            {
                this.callSync.Release();
                base.TrExit(method);
            }
        }