/// <summary> /// Stop the message broker. /// </summary> public void Stop() { StopServices(); StopEndpoints(); if (_globalScope != null) { _globalScope.Stop(); _globalScope.Dispose(); _globalScope = null; } UnregisterMessageBroker(); }
/// <summary> /// Start the message broker. /// </summary> public void Start() { RegisterMessageBroker(); //Each Application has its own Scope hierarchy and the root scope is WebScope. //There's a global scope that aims to provide common resource sharing across Applications namely GlobalScope. //The GlobalScope is the parent of all WebScopes. //Other scopes in between are all instances of Scope. Each scope takes a name. //The GlobalScope is named "default". //The WebScope is named per Application context name. //The Scope is named per path name. _globalScope = new GlobalScope(); _globalScope.Name = "default"; ScopeResolver scopeResolver = new ScopeResolver(_globalScope); FluorineFx.Messaging.Api.IClientRegistry clientRegistry = _clientManager; ServiceInvoker serviceInvoker = new ServiceInvoker(); ScopeContext context = new ScopeContext("/", clientRegistry, scopeResolver, serviceInvoker, null); CoreHandler handler = new CoreHandler(); _globalScope.Context = context; _globalScope.Handler = handler; _globalScope.Register(); StartServices(); StartEndpoints(); }