internal AggregateExpirationHint GetRoutableClone(PoolManager poolManager, Address sourceNode)
        {
            if (_hints == null || _hints.Count == 0)
            {
                return(null);
            }

            AggregateExpirationHint hint = Create(poolManager);

            NodeExpiration ne = null;

            for (int i = 0; i < _hints.Count; i++)
            {
                ExpirationHint eh = (ExpirationHint)_hints[i];
                if (!eh.IsRoutable && ne == null)
                {
                    ne = NodeExpiration.Create(poolManager, sourceNode);
                    hint.Add(ne);
                }
                else
                {
                    hint.Add(eh);
                }
            }
            return(hint);
        }
Example #2
0
        internal AggregateExpirationHint GetRoutableClone(Address sourceNode)
        {
            if (_hints == null || _hints.Count == 0)
            {
                return(null);
            }

            AggregateExpirationHint hint = new AggregateExpirationHint();

            NodeExpiration ne = null;

            for (int i = 0; i < _hints.Count; i++)
            {
                ExpirationHint eh = (ExpirationHint)_hints[i];
                if (!eh.IsRoutable && ne == null)
                {
                    ne = new NodeExpiration(sourceNode);
                    hint.Add(ne);
                }
                else
                {
                    hint.Add(eh);
                }
            }
            return(hint);
        }
Example #3
0
        public static ExpirationHint ReadExpHint(CompactReader reader, PoolManager poolManager)
        {
            ExpirationHintType expHint = ExpirationHintType.Parent;

            expHint = (ExpirationHintType)reader.ReadInt16();

            switch (expHint)
            {
            case ExpirationHintType.NULL:
                return(null);

            case ExpirationHintType.Parent:
                return((ExpirationHint)reader.ReadObject());

            case ExpirationHintType.FixedExpiration:
                var fe = FixedExpiration.Create(poolManager);
                fe.Deserialize(reader);
                return(fe);

            case ExpirationHintType.TTLExpiration:
                var ttle = TTLExpiration.Create(poolManager);
                ((ICompactSerializable)ttle).Deserialize(reader);
                return(ttle);

            case ExpirationHintType.FixedIdleExpiration:
                var fie = FixedIdleExpiration.Create(poolManager);
                ((ICompactSerializable)fie).Deserialize(reader);
                return(fie);

#if !(DEVELOPMENT || CLIENT)
            case ExpirationHintType.NodeExpiration:
                var ne = NodeExpiration.Create(poolManager);
                ((ICompactSerializable)ne).Deserialize(reader);
                return(ne);
#endif
            case ExpirationHintType.IdleExpiration:
                var ie = IdleExpiration.Create(poolManager);
                ((ICompactSerializable)ie).Deserialize(reader);
                return(ie);

            case ExpirationHintType.AggregateExpirationHint:
                var aeh = AggregateExpirationHint.Create(poolManager);
                ((ICompactSerializable)aeh).Deserialize(reader);
                return(aeh);

            case ExpirationHintType.DependencyHint:
                break;

            default:
                break;
            }
            return(null);
        }
Example #4
0
        public static ExpirationHint ReadExpHint(CompactReader reader)
        {
            ExpirationHintType expHint = ExpirationHintType.Parent;

            expHint = (ExpirationHintType)reader.ReadInt16();
            ExpirationHint tmpObj = null;

            switch (expHint)
            {
            case ExpirationHintType.NULL:
                return(null);

            case ExpirationHintType.Parent:
                tmpObj = (ExpirationHint)reader.ReadObject();
                return((ExpirationHint)tmpObj);

            case ExpirationHintType.FixedExpiration:
                FixedExpiration fe = new FixedExpiration();
                ((ICompactSerializable)fe).Deserialize(reader);
                return((ExpirationHint)fe);

            case ExpirationHintType.TTLExpiration:
                TTLExpiration ttle = new TTLExpiration();
                ((ICompactSerializable)ttle).Deserialize(reader);
                return((ExpirationHint)ttle);

            case ExpirationHintType.TTLIdleExpiration:
                TTLIdleExpiration ttlie = new TTLIdleExpiration();
                ((ICompactSerializable)ttlie).Deserialize(reader);
                return((ExpirationHint)ttlie);

            case ExpirationHintType.FixedIdleExpiration:
                FixedIdleExpiration fie = new FixedIdleExpiration();
                ((ICompactSerializable)fie).Deserialize(reader);
                return((ExpirationHint)fie);

            case ExpirationHintType.FileDependency:
                FileDependency fd = new FileDependency();
                ((ICompactSerializable)fd).Deserialize(reader);
                return((ExpirationHint)fd);

            case ExpirationHintType.KeyDependency:
                KeyDependency kd = new KeyDependency();
                ((ICompactSerializable)kd).Deserialize(reader);
                return((ExpirationHint)kd);

#if !(DEVELOPMENT || CLIENT)
            case ExpirationHintType.NodeExpiration:
                NodeExpiration ne = new NodeExpiration();
                ((ICompactSerializable)ne).Deserialize(reader);
                return((ExpirationHint)ne);
#endif
            case ExpirationHintType.Sql7CacheDependency:
                Sql7CacheDependency s7cd = new Sql7CacheDependency();
                ((ICompactSerializable)s7cd).Deserialize(reader);
                return((ExpirationHint)s7cd);

            case ExpirationHintType.OleDbCacheDependency:
                OleDbCacheDependency oledbDependency = new OleDbCacheDependency();
                ((ICompactSerializable)oledbDependency).Deserialize(reader);
                return((ExpirationHint)oledbDependency);

            case ExpirationHintType.SqlYukonCacheDependency:
                SqlYukonCacheDependency sycd = new SqlYukonCacheDependency();
                ((ICompactSerializable)sycd).Deserialize(reader);
                return((ExpirationHint)sycd);

            case ExpirationHintType.OracleCacheDependency:
                OracleCacheDependency orclcd = new OracleCacheDependency();
                ((ICompactSerializable)orclcd).Deserialize(reader);
                return((ExpirationHint)orclcd);


            case ExpirationHintType.IdleExpiration:
                IdleExpiration ie = new IdleExpiration();
                ((ICompactSerializable)ie).Deserialize(reader);
                return((ExpirationHint)ie);

            case ExpirationHintType.AggregateExpirationHint:
                AggregateExpirationHint aeh = new AggregateExpirationHint();
                ((ICompactSerializable)aeh).Deserialize(reader);
                return((ExpirationHint)aeh);

            case ExpirationHintType.DBCacheDependency:
                DBCacheDependency dbcd = new DBCacheDependency();
                ((ICompactSerializable)dbcd).Deserialize(reader);
                return((ExpirationHint)dbcd);

            case ExpirationHintType.ExtensibleDependency:
                ExtensibleDependency ed = new ExtensibleDependency();
                ed = (ExtensibleDependency)reader.ReadObject();
                return((ExpirationHint)ed);

            case ExpirationHintType.NosDBCacheDependency:
                NosDBCacheDependency nosDbd = new NosDBCacheDependency();
                ((ICompactSerializable)nosDbd).Deserialize(reader);
                return(nosDbd);

            case ExpirationHintType.DependencyHint:
                break;

            default:
                break;
            }
            return(null);
        }