public GetTokenTask(AmqpRelay.TokenRenewer tokenRenewer, TimeSpan timeout) { this.tokenRenewer = tokenRenewer; this.appliesTo = tokenRenewer.appliesTo; this.action = tokenRenewer.action; this.timeout = timeout; }
private static void OnRenewToken(object state) { AmqpRelay.TokenRenewer tokenRenewer = (AmqpRelay.TokenRenewer)state; try { tokenRenewer.GetTokenAsync(AmqpRelay.TokenRenewer.GetTokenTimeout).Fork(); } catch (Exception exception1) { Exception exception = exception1; if (Fx.IsFatal(exception)) { throw; } Fx.Exception.TraceHandled(exception, "TokenRenewer.OnRenewToken", null); } }
public AmqpRelay(Uri serviceBusUri, TokenProvider tokenProvider, ConnectivitySettings connectivitySettings = null, HttpConnectivitySettings httpConnectivitySettings = null) { this.serviceBusUri = serviceBusUri; if (tokenProvider != null) { this.tokenRenewer = new AmqpRelay.TokenRenewer(tokenProvider, this.serviceBusUri.AbsoluteUri, "Listen"); } this.RelayClientAuthorizationRequired = true; this.IsDynamic = true; this.State = AmqpObjectState.Start; this.ListenerType = Microsoft.ServiceBus.ListenerType.RoutedHttp; this.onAmqpObjectClosed = new EventHandler(this.OnAmqpObjectClosed); this.ThisLock = new object(); this.connectivitySettings = connectivitySettings; this.httpConnectivitySettings = httpConnectivitySettings; this.activity = new EventTraceActivity(); }