コード例 #1
0
        internal int WriteStruct(NmqiEnvironment env, byte[] b, int Offset)
        {
            uint method = 0x4a0;

            this.TrEntry(method, new object[] { env, b, Offset });
            IntPtr zero = IntPtr.Zero;
            int    cb   = GetLength(env, this.spiGetOptions.version, 4);

            try
            {
                zero = Marshal.AllocCoTaskMem(cb);
                try
                {
                    Marshal.StructureToPtr(this.spiGetOptions, zero, false);
                    Marshal.Copy(zero, b, Offset, cb);
                }
                finally
                {
                    Marshal.FreeCoTaskMem(zero);
                }
            }
            finally
            {
                base.TrExit(method);
            }
            return(cb);
        }
コード例 #2
0
 public MQPlainSocket(NmqiEnvironment env, MQTCPConnection conn, Socket socket) : base(env)
 {
     base.TrConstructor("%Z% %W% %I% %E% %U%");
     this.stream           = socket;
     this.env              = env;
     this.owningConnection = conn;
 }
コード例 #3
0
 internal MQFAPConnectionPool(NmqiEnvironment nmqiEnv, MQFAP fap) : base(nmqiEnv)
 {
     this.allConnectionSpecs = new Hashtable();
     this.callSync           = new Lock();
     base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { nmqiEnv, fap });
     this.fap = fap;
 }
コード例 #4
0
        internal int ReadStruct(NmqiEnvironment env, byte[] b, int Offset)
        {
            uint method = 0x4a1;

            this.TrEntry(method, new object[] { env, b, Offset });
            IntPtr zero    = IntPtr.Zero;
            int    cb      = 0;
            int    version = BitConverter.ToInt32(b, Offset + 4);

            cb = GetLength(env, version, 4);
            try
            {
                zero = Marshal.AllocCoTaskMem(cb);
                if (cb > (b.Length - Offset))
                {
                    cb = b.Length - Offset;
                }
                try
                {
                    Marshal.Copy(b, Offset, zero, cb);
                    this.spiGetOptions = (structSPIGETOPTIONS)Marshal.PtrToStructure(zero, typeof(structSPIGETOPTIONS));
                }
                finally
                {
                    Marshal.FreeCoTaskMem(zero);
                }
            }
            finally
            {
                base.TrExit(method);
            }
            return(Offset + GetLength(env, version, 4));
        }
コード例 #5
0
 public UnmanagedHconn(NmqiEnvironment env, object userworkerThread, int value) : base(env)
 {
     this.sharedHConnLock = new object();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { env, userworkerThread, value });
     this.value_          = value;
     this.useWorkerThread = userworkerThread;
 }
コード例 #6
0
ファイル: NmqiTools.cs プロジェクト: halfsilvered/TestCodes
        public static byte[] StringToQmgrBytes(NmqiEnvironment env, Hconn hconn, string str, byte[] charAttrs, int offset, int length)
        {
            Encoding dotnetEncoding = MQCcsidTable.GetDotnetEncoding(hconn.Ccsid);

            byte[] bytes = dotnetEncoding.GetBytes(str);
            if (bytes.Length > length)
            {
                NmqiException exception = new NmqiException(env, -1, null, 2, 0x7d5, null);
                env.LastException = exception;
                throw exception;
            }
            if ((offset + length) > charAttrs.Length)
            {
                NmqiException exception2 = new NmqiException(env, -1, null, 2, 0x7d5, null);
                env.LastException = exception2;
                throw exception2;
            }
            for (int i = 0; i < bytes.Length; i++)
            {
                charAttrs[offset + i] = bytes[i];
            }
            byte[] buffer2 = dotnetEncoding.GetBytes(" ");
            for (int j = bytes.Length; j < length; j++)
            {
                charAttrs[offset + j] = buffer2[0];
            }
            return(bytes);
        }
コード例 #7
0
 static MQTransactionRecovery()
 {
     nmqiEnv = NmqiFactory.GetInstance(null);
     log     = new MQMonitorLogWritter(nmqiEnv);
     log.WriteLog("WMQ .NET XA Recovery Monitor has started running..");
     log.WriteLog(tmAddrAsString.ToString());
 }
コード例 #8
0
 public NmqiXAResourceManager(NmqiEnvironment env, ManagedHconn hConn) : base(env)
 {
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { env, hConn });
     this.hconn        = hConn;
     base.env          = env;
     this.transTimeout = TransactionManager.MaximumTimeout.TotalMilliseconds;
     base.TrText("Transaction Timeout value = " + this.transTimeout);
 }
コード例 #9
0
 public MQDispatchThread(NmqiEnvironment nmqiEnv, MQFAP fap, ManagedHconn hconn) : base(nmqiEnv)
 {
     this.sleepingEventSync = new Lock();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { nmqiEnv, fap, hconn });
     this.fap         = fap;
     this.hconn       = hconn;
     this.hconnActive = true;
 }
コード例 #10
0
 public MQManagedReconnectableThread(NmqiEnvironment env, MQFAP fap) : base(env)
 {
     this.defaultDelayTimes = new int[] { 0x3e8, 0x7d0, 0xfa0, 0x1f40, 0x3e80, 0x61a8 };
     this.reconnectMutex    = new object();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { env, fap });
     this.hconns = new ArrayList();
     this.fap    = fap;
     this.BuildReconnectionTimes();
 }
コード例 #11
0
ファイル: ManagedHsub.cs プロジェクト: halfsilvered/TestCodes
 public ManagedHsub(NmqiEnvironment env, int hsub, ManagedHobj hobj, MQSubscriptionDescriptor subDescriptor, LpiSD spiSD, bool spiCall) : base(env)
 {
     this.initialSubscriptionTime = DateTime.Now.Millisecond;
     this.hsub = -1;
     base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { env, hsub, hobj, subDescriptor });
     this.hsub                  = hsub;
     this.remoteHobj            = hobj;
     this.subDescriptor         = env.NewMQSD();
     this.subDescriptor.Version = subDescriptor.Version;
     if (subDescriptor.AlternateUserId != null)
     {
         this.subDescriptor.AlternateUserId = subDescriptor.AlternateUserId;
     }
     this.subDescriptor.AlternateSecurityId = subDescriptor.AlternateSecurityId;
     if (subDescriptor.ObjectName != null)
     {
         this.subDescriptor.ObjectName = subDescriptor.ObjectName;
     }
     if (subDescriptor.ObjectString.VSString != null)
     {
         this.subDescriptor.ObjectString.VSString  = subDescriptor.ObjectString.VSString;
         this.subDescriptor.ObjectString.VSBufSize = subDescriptor.ObjectString.VSBufSize;
         this.subDescriptor.ObjectString.VSLength  = subDescriptor.ObjectString.VSLength;
     }
     if (subDescriptor.SubName.VSString != null)
     {
         this.subDescriptor.SubName.VSString  = subDescriptor.SubName.VSString;
         this.subDescriptor.SubName.VSBufSize = subDescriptor.SubName.VSBufSize;
     }
     if (subDescriptor.SelectionString.VSString != null)
     {
         this.subDescriptor.SelectionString.VSString  = subDescriptor.SelectionString.VSString;
         this.subDescriptor.SelectionString.VSBufSize = subDescriptor.SelectionString.VSBufSize;
     }
     if (subDescriptor.ResObjectString.VSString != null)
     {
         this.subDescriptor.ResObjectString.VSString  = subDescriptor.ResObjectString.VSString;
         this.subDescriptor.ResObjectString.VSBufSize = subDescriptor.ResObjectString.VSBufSize;
     }
     this.subDescriptor.Options   = subDescriptor.Options;
     this.subDescriptor.SubExpiry = subDescriptor.SubExpiry;
     this.subDescriptor.SubLevel  = subDescriptor.SubLevel;
     if (spiSD != null)
     {
         this.spiSD = env.NewSpiSD();
         try
         {
             byte[] b = new byte[spiSD.GetRequiredBufferSize()];
             spiSD.WriteStruct(b, 0);
             this.spiSD.ReadStruct(b, 0);
         }
         catch (NmqiException)
         {
         }
     }
     this.spiCall = spiCall;
 }
コード例 #12
0
 public MQProxyQueueManager(NmqiEnvironment env, ManagedHconn hconn) : base(env)
 {
     this.proxyQueues   = new Dictionary <int, MQProxyQueue>();
     this.findingPQueue = new Lock();
     this.deletePQueue  = new Lock();
     this.synchornize   = new Lock();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { env, hconn });
     this.hconn = hconn;
 }
コード例 #13
0
        public int GetRequiredBufferSize(NmqiEnvironment env, int ptrSize)
        {
            uint method = 0x49f;

            this.TrEntry(method, new object[] { env, ptrSize });
            int result = GetLength(env, this.spiGetOptions.version, ptrSize);

            base.TrExit(method, result);
            return(result);
        }
コード例 #14
0
 internal MQPeerNameMatching(NmqiEnvironment env, MQTCPConnection conn, string DN, bool validate) : base(env)
 {
     this.DC = new List <string>();
     this.OU = new List <string>();
     base.TrConstructor("%Z% %W%  %I% %E% %U%");
     this.env = env;
     this.owningConnection = conn;
     this.originalName     = DN;
     this.matcher          = validate;
     this.ParseDN(DN);
 }
コード例 #15
0
 public static UnmanagedHconn GetUnmanagedHconn(NmqiEnvironment env, object userWorkerThread, Hconn hconn)
 {
     if (hconn is UnmanagedHconn)
     {
         return((UnmanagedHconn)hconn);
     }
     if (hconn is HconnAdapter)
     {
         return(new UnmanagedHconn(env, userWorkerThread, 0));
     }
     return(new UnmanagedHconn(env, userWorkerThread));
 }
コード例 #16
0
 public static BindingsHconn GetBindingsHconn(NmqiEnvironment env, object userWorkerThread, Hconn hconn)
 {
     if (hconn is BindingsHconn)
     {
         return((BindingsHconn)hconn);
     }
     if (hconn is HconnAdapter)
     {
         return(new BindingsHconn(env, userWorkerThread, 0));
     }
     return(new BindingsHconn(env, userWorkerThread));
 }
コード例 #17
0
 public static UnmanagedHobj GetUnmanagedHobj(NmqiEnvironment env, IBM.WMQ.Nmqi.Hobj hobj)
 {
     if (hobj is UnmanagedHobj)
     {
         return((UnmanagedHobj)hobj);
     }
     if (hobj.Equals(0))
     {
         return(new UnmanagedHobj(env, 0));
     }
     return(new UnmanagedHobj(env, -1));
 }
コード例 #18
0
 public static BindingsHobj GetBindingsHobj(NmqiEnvironment env, IBM.WMQ.Nmqi.Hobj hobj)
 {
     if (hobj is BindingsHobj)
     {
         return((BindingsHobj)hobj);
     }
     if (hobj.Equals(0))
     {
         return(new BindingsHobj(env, 0));
     }
     return(new BindingsHobj(env, -1));
 }
コード例 #19
0
 internal MQRecoveryEnlistment(ManagedHconn manHconn, NmqiEnvironment env, sbyte[] xid, int rmid) : base(env)
 {
     this.recoveryXid    = new MQXid();
     this.xidList        = new MQXid[XIDLIST_COUNT];
     this.incompleteXids = new ArrayList();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { manHconn, env, xid, rmid });
     this.recoveryHconn = manHconn;
     this.xid_          = new byte[xid.Length];
     Buffer.BlockCopy(xid, 0, this.xid_, 0, this.xid_.Length);
     this.recoveryXid.ReadXidFromBytes(this.xid_, 0);
     this.rmid_ = rmid;
     this.CheckXidListedIncompleteInWMQ();
 }
コード例 #20
0
 internal MQConnectionSpecification(NmqiEnvironment nmqiEnv, MQFAPConnectionPool mqConnectionPool, MQChannelDefinition mqcd, MQSSLConfigOptions sslConfigOptions, int nmqiFlags, string uidFlowUserId, string uidFlowPassword, int ccsid) : base(nmqiEnv)
 {
     this.connectionsLock     = new Lock();
     this.eligibleConnections = new ArrayList();
     base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { nmqiEnv, mqConnectionPool, mqcd, nmqiFlags, uidFlowUserId, (uidFlowPassword == null) ? uidFlowPassword : "******", ccsid });
     this.connectionPool  = mqConnectionPool;
     this.mqcd            = mqcd;
     this.mqsco           = sslConfigOptions;
     this.nmqiFlags       = nmqiFlags;
     this.uidFlowUserId   = uidFlowUserId;
     this.uidFlowPassword = uidFlowPassword;
     this.ccsid           = ccsid;
 }
コード例 #21
0
ファイル: ManagedHobj.cs プロジェクト: halfsilvered/TestCodes
 public static IBM.WMQ.Nmqi.Hobj GetHobj(NmqiEnvironment env, ManagedHobj localhobj)
 {
     if (localhobj == null)
     {
         return(new ManagedHobj(env));
     }
     switch (localhobj.value_)
     {
     case 0:
     case -1:
         return(new ManagedHobj(env));
     }
     return(localhobj);
 }
コード例 #22
0
        public static IBM.WMQ.Nmqi.Hobj GetHobj(NmqiEnvironment env, UnmanagedHobj localhobj)
        {
            int initHobjValue = localhobj.value_;

            switch (initHobjValue)
            {
            case -1:
                return(new HobjAdapter(initHobjValue));

            case 0:
                return(new HobjAdapter(initHobjValue));
            }
            return(localhobj);
        }
コード例 #23
0
ファイル: ManagedHobj.cs プロジェクト: halfsilvered/TestCodes
 public ManagedHobj(NmqiEnvironment env, int hobjInteger, MQProxyQueue proxyQueue, string objectName, int objectType, int openOptions, int defaultPersistence, int defaultPutReponseType, int defaultReadAhead, int defaultPropertyControl, MQObjectDescriptor objectDescriptor) : base(env)
 {
     base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { env, hobjInteger, proxyQueue, objectName, objectType, openOptions, defaultPersistence, defaultPutReponseType, defaultReadAhead, defaultPropertyControl, objectDescriptor });
     this.value_                 = hobjInteger;
     this.proxyQueue             = proxyQueue;
     this.objectName             = objectName;
     this.objectType             = objectType;
     this.openOptions            = openOptions;
     this.defaultPersistence     = defaultPersistence;
     this.defaultPutResponseType = defaultPutReponseType;
     this.defaultReadAhead       = defaultReadAhead;
     this.objectDescriptor       = objectDescriptor;
     this.defaultPropertyControl = defaultPropertyControl;
 }
コード例 #24
0
        public static int GetLength(NmqiEnvironment env, int version, int ptrSize)
        {
            switch (version)
            {
            case 1:
                return(GetLengthV1(ptrSize));

            case 2:
                return(GetLengthV2(ptrSize));
            }
            NmqiException exception = new NmqiException(env, -1, null, 2, 0x893, null);

            env.LastException = exception;
            throw exception;
        }
コード例 #25
0
ファイル: MQSession.cs プロジェクト: halfsilvered/TestCodes
        internal MQSession(NmqiEnvironment env, MQFAPConnection connection) : base(env)
        {
            this.rcvExitLockCheck     = new Lock();
            this.rcvExitLock          = new Lock();
            this.asyncTshLock         = new Lock();
            this.asyncTshQueue        = new Queue <MQTSH>();
            this.rmid                 = -1;
            this.requestEntryMutex    = new Lock();
            this.rmtReqEntMaxPollTime = 0x7d0;
            this.sessionMultiplexed   = -1;
            base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { env, connection });
            MQClientCfg cfg = env.Cfg;

            this.parentConnection = connection;
        }
コード例 #26
0
 public NmqiException(NmqiEnvironment env, int amqXXXX, string[] inserts, int compCode, int reason, Exception nestedException) : base(compCode, reason)
 {
     this.env     = env;
     this.amqXXXX = amqXXXX;
     if (inserts != null)
     {
         this.inserts = new string[inserts.Length];
         for (int i = 0; i < inserts.Length; i++)
         {
             this.inserts[i] = inserts[i];
         }
     }
     this.compCode = compCode;
     this.reason   = reason;
 }
コード例 #27
0
ファイル: NmqiFactory.cs プロジェクト: halfsilvered/TestCodes
        public static NmqiEnvironment GetInstance(NmqiPropertyHandler properties)
        {
            NmqiEnvironment environment = null;

            lock (synchronizer)
            {
                environment = (NmqiEnvironment)mqiCache[Type.GetType("IBM.WMQ.Nmqi.NmqiEnvironment").ToString()];
                if (environment == null)
                {
                    environment = new NmqiEnvironment(properties);
                    string key = Type.GetType("IBM.WMQ.Nmqi.NmqiEnvironment").ToString();
                    mqiCache.Add(key, environment);
                }
            }
            return(environment);
        }
コード例 #28
0
ファイル: NmqiTools.cs プロジェクト: halfsilvered/TestCodes
        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;
        }
コード例 #29
0
 public MQEncryptedSocket(NmqiEnvironment env, MQTCPConnection conn, Socket socket, MQChannelDefinition mqcd, MQSSLConfigOptions sslConfigOptions) : base(env)
 {
     this.keyStore    = "*SYSTEM";
     this.sslProtocol = SslProtocols.Tls;
     try
     {
         base.TrConstructor("%Z% %W%  %I% %E% %U%");
         this.env = env;
         this.owningConnection = conn;
         this.clientCertName   = "ibmwebspheremq" + Environment.UserName.ToLower();
         this.RetrieveAndValidateSSLParams(mqcd, sslConfigOptions);
         this.client        = new TcpClient();
         this.client.Client = socket;
         this.MakeSecuredConnection();
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #30
0
ファイル: NmqiTools.cs プロジェクト: halfsilvered/TestCodes
 public static byte[] GetUtf8Bytes(NmqiEnvironment env, string str, string name)
 {
     if (str == null)
     {
         return(new byte[0]);
     }
     try
     {
         return(Encoding.GetEncoding("UTF-8").GetBytes(str));
     }
     catch (IOException exception)
     {
         string[] strArray2 = new string[3];
         strArray2[0] = GetExSumm(exception);
         strArray2[2] = exception.Source;
         string[]      inserts    = strArray2;
         NmqiException exception2 = new NmqiException(env, 0x254a, inserts, 2, 0x893, exception);
         env.LastException = exception2;
         throw exception2;
     }
     return(null);
 }