Example #1
0
 public void RenewLock()
 {
     base.ThrowIfDisposed();
     try
     {
         TrackingContext instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path);
         MessageSession.TraceRenewLock(EventTraceActivity.CreateFromThread(), instance);
         this.LockedUntilUtc = this.OnRenewLock(instance, this.OperationTimeout);
     }
     catch (Exception exception1)
     {
         Exception exception = exception1;
         if (!Fx.IsFatal(exception))
         {
             throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(exception, null);
         }
         throw;
     }
 }
Example #2
0
        public IAsyncResult BeginRenewLock(AsyncCallback callback, object state)
        {
            IAsyncResult asyncResult;

            base.ThrowIfDisposed();
            try
            {
                TrackingContext instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path);
                MessageSession.TraceRenewLock(EventTraceActivity.CreateFromThread(), instance);
                MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, instance, MessageSession.SessionOperation.RenewSessionLock, null, this.OperationTimeout, callback, state);
                retrySessionAsyncResult.Start();
                asyncResult = retrySessionAsyncResult;
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                if (!Fx.IsFatal(exception))
                {
                    throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.AsError(exception, null);
                }
                throw;
            }
            return(asyncResult);
        }