예제 #1
0
		public override void Activate(UnmarshallingContext context)
		{
			object obj = Read(context);
			// Activation of members is necessary on purpose here.
			// Classes like Hashtable need fully activated members
			// to be able to calculate hashCode()
			if (obj != null)
			{
				context.Container().Activate(context.Transaction(), obj, context.ActivationDepth(
					));
			}
			SetOn(context.Transaction(), context.PersistentObject(), obj);
		}
예제 #2
0
 private object Activate(UnmarshallingContext context)
 {
     var obj = context.PersistentObject();
     var objectReference = context.ObjectReference();
     if (!ObjectCanActivate(context.Transaction(), obj))
     {
         objectReference.SetStateDeactivated();
         return obj;
     }
     objectReference.SetStateClean();
     if (context.ActivationDepth().RequiresActivation())
     {
         InstantiateFields(context);
     }
     ObjectOnActivate(context.Transaction(), objectReference);
     return obj;
 }
예제 #3
0
 public virtual object Instantiate(UnmarshallingContext context)
 {
     // overridden in PrimitiveTypeMetadata
     // never called for primitive YapAny
     // FIXME: [TA] no longer necessary?
     //        context.adjustInstantiationDepth();
     var obj = context.PersistentObject();
     var instantiating = (obj == null);
     if (instantiating)
     {
         obj = InstantiateObject(context);
         if (obj == null)
         {
             return null;
         }
         ShareTransaction(obj, context.Transaction());
         ShareObjectReference(obj, context.ObjectReference());
         OnInstantiate(context, obj);
         if (context.ActivationDepth().Mode().IsPrefetch())
         {
             context.ObjectReference().SetStateDeactivated();
             return obj;
         }
         if (!context.ActivationDepth().RequiresActivation())
         {
             context.ObjectReference().SetStateDeactivated();
             return obj;
         }
         return Activate(context);
     }
     if (ActivatingActiveObject(context.ActivationDepth().Mode(), context.ObjectReference
         ()))
     {
         var child = context.ActivationDepth().Descend(this);
         if (child.RequiresActivation())
         {
             CascadeActivation(new ActivationContext4(context.Transaction(), obj, child));
         }
         return obj;
     }
     return Activate(context);
 }
예제 #4
0
 protected void OnInstantiate(UnmarshallingContext context, object obj)
 {
     context.SetObjectWeak(obj);
     context.Transaction().ReferenceSystem().AddExistingReference(context.ObjectReference
         ());
     ObjectOnInstantiate(context.Transaction(), context.ObjectReference());
 }
예제 #5
0
		public override void Activate(UnmarshallingContext context)
		{
			if (!CheckAlive(context))
			{
				return;
			}
			if (!ShouldStoreField())
			{
				IncrementOffset(context);
				return;
			}
			object toSet = Read(context);
			InformAboutTransaction(toSet, context.Transaction());
			Set(context.PersistentObject(), toSet);
		}