CreateWellKnownObject() static private méthode

static private CreateWellKnownObject ( String uri ) : ServerIdentity
uri String
Résultat ServerIdentity
Exemple #1
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static Identity CasualResolveIdentity(String uri)
        {
            if (uri == null)
            {
                return(null);
            }

            Identity id = CasualResolveReference(URITable[MakeURIKeyNoLower(uri)]);

            if (id == null)
            {
                id = CasualResolveReference(URITable[MakeURIKey(uri)]);

                // DevDiv 720951 and 911924:
                // CreateWellKnownObject inserts the Identity into the URITable before
                // it is fully initialized.  This can cause a race condition if another
                // concurrent operation re-enters this code and attempts to use it.
                // If we discover this situation, behave as if it is not in the URITable.
                // This falls into the code below to call CreateWellKnownObject again.
                // That method operates under a lock and will not return until it
                // has been fully initialized.  It will not create or initialize twice.
                if (id == null || id.IsInitializing)
                {
                    // Check if this a well-known object which needs to be faulted in
                    id = RemotingConfigHandler.CreateWellKnownObject(uri);
                }
            }

            return(id);
        } // CasualResolveIdentity
        } // ResolveIdentity

        // If the identity isn't found, this version will just return
        //   null instead of asserting (this version doesn't need to
        //   take a lock).
        internal static Identity CasualResolveIdentity(String uri)
        {
            if (uri == null)
            {
                return(null);
            }

            Identity id = CasualResolveReference(URITable[MakeURIKey(uri)]);

            if (id == null)
            {
                // Check if this a well-known object which needs to be faulted in
                id = RemotingConfigHandler.CreateWellKnownObject(uri);
            }

            return(id);
        } // CasualResolveIdentity
        internal static Identity CasualResolveIdentity(string uri)
        {
            if (uri == null)
            {
                return(null);
            }
            Identity identity = CasualResolveReference(URITable[MakeURIKeyNoLower(uri)]);

            if (identity == null)
            {
                identity = CasualResolveReference(URITable[MakeURIKey(uri)]);
                if (identity == null)
                {
                    identity = RemotingConfigHandler.CreateWellKnownObject(uri);
                }
            }
            return(identity);
        }
Exemple #4
0
        internal static Identity CasualResolveIdentity(string uri)
        {
            if (uri == null)
            {
                return((Identity)null);
            }
            Identity identity = IdentityHolder.CasualResolveReference(IdentityHolder.URITable[(object)IdentityHolder.MakeURIKeyNoLower(uri)]);

            if (identity == null)
            {
                identity = IdentityHolder.CasualResolveReference(IdentityHolder.URITable[(object)IdentityHolder.MakeURIKey(uri)]);
                if (identity == null || identity.IsInitializing)
                {
                    identity = (Identity)RemotingConfigHandler.CreateWellKnownObject(uri);
                }
            }
            return(identity);
        }