System.Runtime.Remoting.IdentityHolder.ResolveIdentity C# (CSharp) Method

ResolveIdentity() static private method

static private ResolveIdentity ( String URI ) : Identity
URI String
return Identity
        internal static Identity ResolveIdentity(String URI)
        {
            if (URI == null)
                throw new ArgumentNullException("URI");
        
            Identity id;
            // We need to guarantee that finally is not interrupted so that the lock is released.
            // TableLock has a long path without reliability contract.  To avoid adding contract on
            // the path, we will use ReaderWriterLock directly.
            ReaderWriterLock rwlock = TableLock;
            bool takeAndRelease = !rwlock.IsReaderLockHeld;

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                if (takeAndRelease)
                    rwlock.AcquireReaderLock(INFINITE);

                Message.DebugOut("ResolveIdentity:: URI: " + URI + "\n");       
                Message.DebugOut("ResolveIdentity:: table.count: " + URITable.Count + "\n");
                //Console.WriteLine("\n ResolveID: URI = " + URI);
                // This may be called both in the client process and the server process (loopback case).
                id = ResolveReference(URITable[MakeURIKey(URI)]);
            }
            finally
            {
                if (takeAndRelease && rwlock.IsReaderLockHeld){
                    rwlock.ReleaseReaderLock();
                }
            }
            return id;
        } // ResolveIdentity

Usage Example

コード例 #1
0
 internal virtual void AssertValid()
 {
     if (this.URI != null)
     {
         Identity identity = IdentityHolder.ResolveIdentity(this.URI);
     }
 }
All Usage Examples Of System.Runtime.Remoting.IdentityHolder::ResolveIdentity