Beispiel #1
0
        /// <summary>
        /// Gets the message queue transaction from thread local storage
        /// </summary>
        /// <param name="resourceFactory">The resource factory.</param>
        /// <returns>null if not found in thread local storage</returns>
        public static MessageQueueTransaction GetMessageQueueTransaction(IResourceFactory resourceFactory)
        {
            MessageQueueResourceHolder resourceHolder =
                (MessageQueueResourceHolder)
                TransactionSynchronizationManager.GetResource(
                    MessageQueueTransactionManager.CURRENT_TRANSACTION_SLOTNAME);

            if (resourceHolder != null)
            {
                return(resourceHolder.MessageQueueTransaction);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 public MessageQueueResourceSynchronization(MessageQueueResourceHolder resourceHolder, object resourceKey)
 {
     this.resourceHolder = resourceHolder;
     this.resourceKey    = resourceKey;
 }
Beispiel #3
0
 public MessageQueueResourceSynchronization(MessageQueueResourceHolder resourceHolder, object resourceKey)
 {
     this.resourceHolder = resourceHolder;
     this.resourceKey = resourceKey;
 }
        /// <summary>
        /// Resume the resources of the current transaction.
        /// </summary>
        /// <param name="transaction">Transaction object returned by
        /// <see cref="Spring.Transaction.Support.AbstractPlatformTransactionManager.DoGetTransaction"/>.</param>
        /// <param name="suspendedResources">The object that holds suspended resources as returned by
        /// <see cref="Spring.Transaction.Support.AbstractPlatformTransactionManager.DoSuspend"/>.</param>
        protected override void DoResume(object transaction, object suspendedResources)
        {
            MessageQueueResourceHolder queueHolder = (MessageQueueResourceHolder)suspendedResources;

            TransactionSynchronizationManager.BindResource(CURRENT_TRANSACTION_SLOTNAME, queueHolder);
        }