예제 #1
0
        public IAsyncResult BeginSetState(Stream stream, AsyncCallback callback, object state)
        {
            IAsyncResult asyncResult;

            base.ThrowIfDisposed();
            try
            {
                TrackingContext instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path);
                MessageSession.TraceSetState(EventTraceActivity.CreateFromThread(), instance, this.SessionId);
                MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, instance, MessageSession.SessionOperation.SetState, stream, 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);
        }
예제 #2
0
 protected virtual void OnSetState(TrackingContext trackingContext, Stream stream, TimeSpan timeout)
 {
     MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, trackingContext, MessageSession.SessionOperation.SetState, stream, timeout, null, null);
     retrySessionAsyncResult.RunSynchronously();
 }
예제 #3
0
 protected virtual DateTime OnRenewLock(TrackingContext trackingContext, TimeSpan timeout)
 {
     MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, trackingContext, MessageSession.SessionOperation.RenewSessionLock, null, this.OperationTimeout, null, null);
     retrySessionAsyncResult.RunSynchronously();
     return(retrySessionAsyncResult.LockedUntilUtcTime);
 }
예제 #4
0
 protected virtual Stream OnGetState(TrackingContext trackingContext, TimeSpan timeout)
 {
     MessageSession.RetrySessionAsyncResult retrySessionAsyncResult = new MessageSession.RetrySessionAsyncResult(this, trackingContext, MessageSession.SessionOperation.GetState, null, this.OperationTimeout, null, null);
     retrySessionAsyncResult.RunSynchronously();
     return(retrySessionAsyncResult.SessionState);
 }