static private RemoveIdentity ( String uri ) : void | ||
uri | String | |
리턴 | void |
internal void AddWellKnownEntry(WellKnownServiceTypeEntry entry, bool fReplace) { if (this.CheckForRedirectedClientType(entry.TypeName, entry.AssemblyName)) { throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_CantUseRedirectedTypeForWellKnownService"), new object[] { entry.TypeName, entry.AssemblyName })); } string key = entry.ObjectUri.ToLower(CultureInfo.InvariantCulture); if (fReplace) { this._wellKnownExportInfo[key] = entry; IdentityHolder.RemoveIdentity(entry.ObjectUri); } else { this._wellKnownExportInfo.Add(key, entry); } }
internal static void RemoveIdentity(string uri) { IdentityHolder.RemoveIdentity(uri, true); }
internal ServerIdentity StartupWellKnownObject(string asmName, string svrTypeName, string URI, WellKnownObjectMode mode, bool fReplace) { lock (s_wkoStartLock) { MarshalByRefObject obj2 = null; ServerIdentity identity = null; Type type = LoadType(svrTypeName, asmName); if (!type.IsMarshalByRef) { throw new RemotingException(Environment.GetResourceString("Remoting_WellKnown_MustBeMBR", new object[] { svrTypeName })); } identity = (ServerIdentity)IdentityHolder.ResolveIdentity(URI); if ((identity != null) && identity.IsRemoteDisconnected()) { IdentityHolder.RemoveIdentity(URI); identity = null; } if (identity == null) { s_fullTrust.Assert(); try { obj2 = (MarshalByRefObject)Activator.CreateInstance(type, true); if (RemotingServices.IsClientProxy(obj2)) { RedirectionProxy proxy = new RedirectionProxy(obj2, type) { ObjectMode = mode }; RemotingServices.MarshalInternal(proxy, URI, type); identity = (ServerIdentity)IdentityHolder.ResolveIdentity(URI); identity.SetSingletonObjectMode(); } else if (type.IsCOMObject && (mode == WellKnownObjectMode.Singleton)) { ComRedirectionProxy proxy2 = new ComRedirectionProxy(obj2, type); RemotingServices.MarshalInternal(proxy2, URI, type); identity = (ServerIdentity)IdentityHolder.ResolveIdentity(URI); identity.SetSingletonObjectMode(); } else { if (RemotingServices.GetObjectUri(obj2) != null) { throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_WellKnown_CtorCantMarshal"), new object[] { URI })); } RemotingServices.MarshalInternal(obj2, URI, type); identity = (ServerIdentity)IdentityHolder.ResolveIdentity(URI); if (mode == WellKnownObjectMode.SingleCall) { identity.SetSingleCallObjectMode(); } else { identity.SetSingletonObjectMode(); } } } catch { throw; } finally { CodeAccessPermission.RevertAssert(); } } return(identity); } }