Beispiel #1
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            interner.Intern(ref _encodingName);
            interner.Intern(ref _type);
        }
Beispiel #2
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            _processName = interner.Intern(_processName);
            _machineName = interner.Intern(_machineName);
        }
Beispiel #3
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            m_culture    = interner.Intern(m_culture);
            m_threadName = interner.Intern(m_threadName);
        }
Beispiel #4
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            _key    = interner.Intern(_key);
            _values = interner.Intern(_values);
        }
Beispiel #5
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            _domain = interner.Intern(_domain);
            _name   = interner.Intern(_name);
            _path   = interner.Intern(_path);
        }
Beispiel #6
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            interner.Intern(ref _hostName);
            interner.Intern(ref _hostAddress);
            interner.Intern(ref _agent);
        }
Beispiel #7
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            interner.Intern(ref m_name);
            interner.Intern(ref m_class);
            interner.TryIntern(ref m_value);
        }
Beispiel #8
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            m_processUserName    = interner.Intern(m_processUserName);
            m_authenticationType = interner.Intern(m_authenticationType);
            m_userName           = interner.Intern(m_userName);
        }
Beispiel #9
0
 public void Intern(Interner interner)
 {
     interner.Intern(_type);
     interner.Intern(ref _helpLink);
     interner.Intern(ref _hResult);
     interner.Intern(ref _message);
     interner.Intern(ref _source);
     interner.Intern(ref _stackTrace);
     interner.Intern(ref _targetSite);
     interner.Intern(ref _toString);
     _properties = interner.Intern(_properties);
     interner.Intern(_innerException);
 }
Beispiel #10
0
        static SiloAddress()
        {
            siloAddressInterningCache = new Interner <SiloAddress, SiloAddress>(INTERN_CACHE_INITIAL_SIZE, internCacheCleanupInterval);
            var sa = new SiloAddress(new IPEndPoint(0, 0), 0);

            Zero = siloAddressInterningCache.Intern(sa, sa);
        }
 /// <summary>Returns a unique object o' that .equals the argument o.</summary>
 /// <remarks>
 /// Returns a unique object o' that .equals the argument o.  If o
 /// itself is returned, this is the first request for an object
 /// .equals to o.
 /// </remarks>
 public virtual T Intern(T o)
 {
     lock (mutex)
     {
         return(delegate_.Intern(o));
     }
 }
Beispiel #12
0
 /// <summary>
 /// Interns and returns a reference to the representative instance
 /// for any of a collection of string instances that are equal to each other.
 /// </summary>
 /// <remarks>
 /// Interns and returns a reference to the representative instance
 /// for any of a collection of string instances that are equal to each other.
 /// Retains weak reference to the instance,
 /// and so does not prevent it from being garbage-collected.
 /// </remarks>
 /// <param name="sample">string instance to be interned</param>
 /// <returns>weak reference to interned string instance</returns>
 public static string WeakIntern(string sample)
 {
     if (sample == null)
     {
         return(null);
     }
     return(weakInterner.Intern(sample));
 }
Beispiel #13
0
 /// <summary>
 /// Interns and returns a reference to the representative instance
 /// for any of a collection of string instances that are equal to each other.
 /// </summary>
 /// <remarks>
 /// Interns and returns a reference to the representative instance
 /// for any of a collection of string instances that are equal to each other.
 /// Retains strong reference to the instance,
 /// thus preventing it from being garbage-collected.
 /// </remarks>
 /// <param name="sample">string instance to be interned</param>
 /// <returns>strong reference to interned string instance</returns>
 public static string StrongIntern(string sample)
 {
     if (sample == null)
     {
         return(null);
     }
     return(strongInterner.Intern(sample));
 }
Beispiel #14
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            interner.Intern(ref _event);
            interner.Intern(ref _source);
            interner.Intern(ref _type);
            interner.Intern(ref _method);
            interner.Intern(ref _message);

            interner.Intern(_exception);
            interner.Intern(_details);

            if (_parameters != null)
            {
                foreach (EventParameter param in _parameters)
                {
                    param.Intern(interner);
                }
            }
        }
        private GrainCancellationToken RecordCancellationToken(Guid tokenId, bool isCancellationRequested)
        {
            GrainCancellationToken localToken;

            if (_cancellationTokens.TryFind(tokenId, out localToken))
            {
                return(localToken);
            }
            return(_cancellationTokens.Intern(tokenId, new GrainCancellationToken(tokenId, isCancellationRequested)));
        }
Beispiel #16
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            interner.Intern(ref _httpMethod);
            interner.Intern(ref _url);
            interner.Intern(ref _rawUrl);
            interner.Intern(ref _urlReferrer);
            _headers.Intern(interner);
            _cookies.Intern(interner);
            _form.Intern(interner);
            _content.Intern(interner);
            _user.Intern(interner);
        }
Beispiel #17
0
        public void Intern(Interner interner)
        {
            const string method = "Intern";

            if (interner == null)
            {
                throw new NullParameterException(GetType(), method, "interner");
            }

            // Build a new collection using interned keys and values and then replace the underlying collection
            // with the new one - should be thread-safe without locking.

            if (m_headers.Count > 0)
            {
                NameValueCollection newHeaders = new NameValueCollection();

                for (int index = 0; index < m_headers.Count; ++index)
                {
                    string   key    = interner.Intern(m_headers.GetKey(index));
                    string[] values = m_headers.GetValues(index);
                    if (values != null)
                    {
                        foreach (string value in values)
                        {
                            newHeaders.Add(key, interner.Intern(value));
                        }
                    }
                    else
                    {
                        newHeaders.Add(key, null);
                    }
                }

                m_headers = newHeaders;
            }
        }
Beispiel #18
0
 internal static string[] InternStringArray(Interner interner, string[] input)
 {
     if (input == null || input.Length == 0)
     {
         return(null);
     }
     else if (interner == null)
     {
         return((string[])input.Clone());
     }
     else
     {
         return(interner.Intern(input));
     }
 }
Beispiel #19
0
 void IInternable.Intern(Interner interner)
 {
     m_assemblyName = interner.Intern(m_assemblyName);
     m_fullName     = interner.Intern(m_fullName);
 }
Beispiel #20
0
 void IInternable.Intern(Interner interner)
 {
     m_name   = interner.Intern(m_name);
     m_parent = interner.Intern(m_parent);
 }
Beispiel #21
0
 void IInternable.Intern(Interner interner)
 {
     m_keyFile  = interner.Intern(m_keyFile);
     m_location = interner.Intern(m_location);
 }
Beispiel #22
0
 void IInternable.Intern(Interner interner)
 {
     m_valueAsXml = interner.Intern(m_valueAsXml);
 }
Beispiel #23
0
 void IInternable.Intern(Interner interner)
 {
     _name      = interner.Intern(_name);
     _namespace = interner.Intern(_namespace);
 }
Beispiel #24
0
        /// <summary>
        /// Factory for creating new SiloAddresses with specified IP endpoint address and silo generation number.
        /// </summary>
        /// <param name="ep">IP endpoint address of the silo.</param>
        /// <param name="gen">Generation number of the silo.</param>
        /// <returns>SiloAddress object initialized with specified address and silo generation.</returns>
        public static SiloAddress New(IPEndPoint ep, int gen)
        {
            var sa = new SiloAddress(ep, gen);

            return(siloAddressInterningCache.Intern(sa, sa));
        }
Beispiel #25
0
 public static QueueId GetQueueId(string queueName, uint queueId, uint hash)
 {
     var key = new QueueId(queueName, queueId, hash);
     return queueIdInternCache.Intern(key, key);
 }