Exemplo n.º 1
0
 public virtual void Test()
 {
     _queue.Add("A");
     _queue.Add("B");
     _queue.Add("B");
     _queue.Add("A");
     Assert.AreEqual("A", _queue.Next());
     Assert.AreEqual("B", _queue.Next());
     Assert.IsFalse(_queue.HasNext());
 }
Exemplo n.º 2
0
 internal virtual void Add(MsgBlob msg)
 {
     lock (queue)
     {
         queue.Add(msg);
     }
 }
Exemplo n.º 3
0
        internal virtual void Process(ClassMetadata newClassMetadata)
        {
            if (_pending.Contains(newClassMetadata))
            {
                return;
            }
            ClassMetadata ancestor = newClassMetadata.GetAncestor();

            if (ancestor != null)
            {
                Process(ancestor);
            }
            _pending.Add(newClassMetadata);
            _members.Add(newClassMetadata);
            if (_running)
            {
                return;
            }
            _running = true;
            try
            {
                CheckInits();
                _pending = new Collection4();
            }
            finally
            {
                _running = false;
            }
        }
 public ClassMetadata ReadClassMetadata(ClassMetadata classMetadata, IReflectClass
                                        clazz)
 {
     if (classMetadata == null)
     {
         throw new ArgumentNullException();
     }
     if (!classMetadata.StateUnread())
     {
         return(classMetadata);
     }
     _classMetadataCreationDepth++;
     try
     {
         classMetadata.ResolveNameConfigAndReflector(this, clazz);
         IReflectClass claxx = classMetadata.ClassReflector();
         if (claxx != null)
         {
             _classMetadataByClass.Put(claxx, classMetadata);
             classMetadata.ReadThis();
             classMetadata.CheckChanges();
             _initClassMetadataOnUp.Add(classMetadata);
         }
     }
     finally
     {
         _classMetadataCreationDepth--;
     }
     InitClassMetadataOnUp();
     return(classMetadata);
 }
Exemplo n.º 5
0
 public virtual void Add(object obj)
 {
     if (_seen.ContainsKey(obj))
     {
         return;
     }
     _queue.Add(obj);
     _seen.Put(obj, obj);
 }
Exemplo n.º 6
0
 private void InitializeAspects()
 {
     while (_members.HasNext())
     {
         ClassMetadata classMetadata = ((ClassMetadata)_members.Next());
         classMetadata.InitializeAspects();
         _statics.Add(classMetadata);
     }
 }
 public override void Run()
 {
     try
     {
         Thread.Sleep(2000);
     }
     catch (Exception)
     {
     }
     _queue.Add(_data);
 }
Exemplo n.º 8
0
 private void CheckStatics()
 {
     InitializeAspects();
     while (_statics.HasNext())
     {
         ClassMetadata classMetadata = ((ClassMetadata)_statics.Next());
         classMetadata.StoreStaticFieldValues(_systemTransaction, true);
         _writes.Add(classMetadata);
         InitializeAspects();
     }
 }
Exemplo n.º 9
0
        public virtual void TestIteratorThrowsOnConcurrentModification()
        {
            object[]    elements = new object[] { "foo", "bar" };
            IQueue4     queue    = NewQueue(elements);
            IEnumerator iterator = queue.Iterator();

            Iterator4Assert.AssertNext("foo", iterator);
            queue.Add("baz");
            Assert.AreEqual("foo", iterator.Current, "accessing current element should be harmless"
                            );
            Assert.Expect(typeof(InvalidOperationException), new _ICodeBlock_31(iterator));
        }
Exemplo n.º 10
0
 private void CheckWrites()
 {
     CheckStatics();
     while (_writes.HasNext())
     {
         ClassMetadata classMetadata = ((ClassMetadata)_writes.Next());
         classMetadata.SetStateDirty();
         classMetadata.Write(_systemTransaction);
         _inits.Add(classMetadata);
         CheckStatics();
     }
 }
Exemplo n.º 11
0
 protected virtual void QueueAdd(object @object)
 {
     _queue.Add(@object);
 }
Exemplo n.º 12
0
 public virtual void RegisterUnindexed(int id)
 {
     _unindexed.Add(id);
 }