internal MQQueue OpenQueueCore(string queueName, OpenQueueMode openMode)
        {
            Debug.Assert(!string.IsNullOrEmpty(queueName));

            var openFlags = MQC.MQOO_FAIL_IF_QUIESCING;

            switch (openMode)
            {
            case OpenQueueMode.ForBrowse:
                openFlags = openFlags | MQC.MQOO_BROWSE;
                break;

            case OpenQueueMode.ForBrowseCo:
                openFlags = openFlags | MQC.MQOO_CO_OP | MQC.MQOO_BROWSE;
                break;

            case OpenQueueMode.ForSet:
                openFlags = openFlags | MQC.MQOO_SET;
                break;

            case OpenQueueMode.ForRead:
                openFlags = openFlags | MQC.MQOO_INPUT_SHARED;
                break;

            case OpenQueueMode.ForWrite:
                openFlags = openFlags | MQC.MQOO_OUTPUT;
                break;

            case OpenQueueMode.ForWriteSetAllContext:
                openFlags = openFlags | MQC.MQOO_OUTPUT | MQC.MQOO_SET_ALL_CONTEXT;
                break;

            case OpenQueueMode.ForWriteSetIdentityContext:
                openFlags = openFlags | MQC.MQOO_OUTPUT | MQC.MQOO_SET_IDENTITY_CONTEXT;
                break;

            case OpenQueueMode.ForWritePassAllContext:
                openFlags = openFlags | MQC.MQOO_OUTPUT | MQC.MQOO_PASS_ALL_CONTEXT;
                break;

            case OpenQueueMode.ForWritePassIdentityContext:
                openFlags = openFlags | MQC.MQOO_OUTPUT | MQC.MQOO_PASS_IDENTITY_CONTEXT;
                break;

            case OpenQueueMode.ForQuery:
                openFlags = openFlags | MQC.MQOO_INQUIRE;
                break;

            case OpenQueueMode.ForBrowseAndRead:
                openFlags = openFlags | MQC.MQOO_BROWSE | MQC.MQOO_INPUT_SHARED;
                break;
            }

            return(RetryOnHCONNError(() =>
            {
                return IbmQueueManager.AccessQueue(queueName, openFlags);
            }));
        }
Exemple #2
0
 internal MQQueue OpenQueueCore(OpenQueueMode openMode)
 {
     return(((WsQueueManager)QueueManager).OpenQueueCore(Name, openMode));
 }