private void guaranteeHashExists()
 {
     if (_cache == null)
     {
         lock (_locker)
         {
             if (_cache == null)
             {
                 _cache = new LifecycleObjectCache();
             }
         }
     }
 }
示例#2
0
 private void guaranteeHashExists()
 {
     if (_cache == null)
     {
         lock (_locker)
         {
             if (_cache == null)
             {
                 _cache = new LifecycleObjectCache();
             }
         }
     }
 }
        public override IObjectCache FindCache(ILifecycleContext context)
        {
            IDictionary items = findHttpDictionary();

            if (!items.Contains(ITEM_NAME))
            {
                lock (items.SyncRoot)
                {
                    if (!items.Contains(ITEM_NAME))
                    {
                        var cache = new LifecycleObjectCache();
                        items.Add(ITEM_NAME, cache);

                        return cache;
                    }
                }
            }

            return (IObjectCache) items[ITEM_NAME];
        }
        public IObjectCache FindCache(ILifecycleContext context)
        {
            IDictionary items = InteractionScope.Items;

            if (!items.Contains(StructureMapInstancesDictionaryKey))
            {
                lock (items.SyncRoot)
                {
                    if (!items.Contains(StructureMapInstancesDictionaryKey))
                    {
                        var cache = new LifecycleObjectCache();
                        items.Add(StructureMapInstancesDictionaryKey, cache);

                        return cache;
                    }
                }
            }

            return (IObjectCache)items[StructureMapInstancesDictionaryKey];
        }
 public void SetUp()
 {
     cache = new LifecycleObjectCache();
 }
 public LifecycleObjectCacheTester()
 {
     cache = new LifecycleObjectCache();
 }