/// <summary> /// Event triggered when broker finished /// </summary> /// <param name="sender">indicating the sender</param> /// <param name="e">indicating the event args</param> private void Entry_BrokerFinished(object sender, EventArgs e) { InprocessSessions.GetInstance().RemoveSessionInstance(this.brokerInfo.SessionId); this.brokerEntry = null; lock (this.frontendAdapters) { foreach (InprocessBrokerFrontendAdapter adapter in this.frontendAdapters) { adapter.ShutdownConnection(); } } }
/// <summary> /// Create broker /// </summary> /// <param name="sessionId">indicating the session id</param> private async Task CreateInternal(string sessionId) { AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(this.CurrentDomain_AssemblyResolve); this.SetIsDiagTraceEnabledProperty(); Assembly brokerCoreAsm = Assembly.LoadFile(this.brokerCoreServiceLibPath); ConstructorInfo ci = brokerCoreAsm.GetType(BrokerEntryClassFullName).GetConstructor(new Type[1] { typeof(string) }); this.brokerEntry = (IBrokerEntry)ci.Invoke(new object[1] { sessionId }); this.brokerEntry.BrokerFinished += new EventHandler(this.Entry_BrokerFinished); this.result = this.brokerEntry.Run(this.startInfoContract, this.brokerInfo); //set isDebugModeEnabled True to jump UpdateBrokerInfo method. if (!this.isDebugModeEnabled && !this.isNoSession) { await this.UpdateBrokerInfo(this.brokerInfo).ConfigureAwait(false); } }
/// <summary> /// Initializes a new instance of the InprocessBrokerFrontendAdapter class /// </summary> /// <param name="brokerEntry">indicating the broker entry instance</param> /// <param name="callbackInstance">indicating the callback instance</param> public InprocessBrokerFrontendAdapter(IBrokerEntry brokerEntry, IResponseServiceCallback callbackInstance) { this.brokerEntry = brokerEntry; this.callbackInstance = callbackInstance; this.BuildFrontend(); }