/// <summary> /// Associates the server service provider with the specified entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <param name="iServerServiceEntry">The server service provider.</param> /// <returns>The server service provider previously associated with this entry or a null reference.</returns> public IServerServiceEntry RegisterServerService(string entryName, IServerServiceEntry iServerServiceEntry) { IServerServiceEntry previousServerServiceEntry = this._services[entryName] as IServerServiceEntry; this._services[entryName] = iServerServiceEntry; return(previousServerServiceEntry); }
/// <summary> /// Unregisters the server service entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <returns>The server service provider previously associated with this entry or a null reference.</returns> public IServerServiceEntry UnregisterServerService(string entryName) { IServerServiceEntry previousServerServiceEntry = this._services[entryName] as IServerServiceEntry; this._services.Remove(entryName); return(previousServerServiceEntry); }
/// <summary> /// Handles the incoming request. /// </summary> /// <param name="message">The response.</param> /// <returns>The response.</returns> public Stream HandleRequest(Message message) { // fetch the name of the server service IServerServiceEntry iServerServiceEntry = null; string entryName = message.DestinationMarshalByRef as string; if (entryName != null) { iServerServiceEntry = this._services[entryName] as IServerServiceEntry; } // there is no service registered in the local collection, try the global collection if (entryName != null && iServerServiceEntry == null) { iServerServiceEntry = _globalServices[entryName] as IServerServiceEntry; } if (iServerServiceEntry == null) { // no services are registered to handle this request // message.ITransportContext.IEventLogger.Log(LogMessageCategory.Error, null, "DirectExchangeManager.HandlerRequest", // null, "There are no services associated with the \"{0}\" name. Incoming request is ignored.", entryName == null ? "<null!>" : entryName); message.ITransportContext.IGenuineEventProvider.Fire(new GenuineEventArgs(GenuineEventType.UnknownServerService, null, message.Sender, entryName)); throw GenuineExceptions.Get_Receive_NoServices(entryName); } return(iServerServiceEntry.HandleMessage(message.Stream, message.Sender)); }
/// <summary> /// Unregisters the global server service entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <returns>The global server service provider previously associated with this entry or a null reference.</returns> public static IServerServiceEntry UnregisterGlobalServerService(string entryName) { IServerServiceEntry previousServerServiceEntry = _globalServices[entryName] as IServerServiceEntry; _globalServices.Remove(entryName); return(previousServerServiceEntry); }
/// <summary> /// Associates the global server service provider with the specified entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <param name="iServerServiceEntry">The server service provider.</param> /// <returns>The server service provider previously associated with this entry or a null reference.</returns> public static IServerServiceEntry RegisterGlobalServerService(string entryName, IServerServiceEntry iServerServiceEntry) { IServerServiceEntry previousServerServiceEntry = _globalServices[entryName] as IServerServiceEntry; _globalServices[entryName] = iServerServiceEntry; return(previousServerServiceEntry); }
/// <summary> /// Associates the global server service provider with the specified entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <param name="iServerServiceEntry">The server service provider.</param> /// <returns>The server service provider previously associated with this entry or a null reference.</returns> public static IServerServiceEntry RegisterGlobalServerService(string entryName, IServerServiceEntry iServerServiceEntry) { IServerServiceEntry previousServerServiceEntry = _globalServices[entryName] as IServerServiceEntry; _globalServices[entryName] = iServerServiceEntry; return previousServerServiceEntry; }
/// <summary> /// Associates the server service provider with the specified entry. /// </summary> /// <param name="entryName">The name of the entry.</param> /// <param name="iServerServiceEntry">The server service provider.</param> /// <returns>The server service provider previously associated with this entry or a null reference.</returns> public IServerServiceEntry RegisterServerService(string entryName, IServerServiceEntry iServerServiceEntry) { IServerServiceEntry previousServerServiceEntry = this._services[entryName] as IServerServiceEntry; this._services[entryName] = iServerServiceEntry; return previousServerServiceEntry; }