Ejemplo n.º 1
0
 public virtual void Commit(ICommittedCallbackDispatcher dispatcher)
 {
     lock (Container().Lock())
     {
         DispatchCommittingCallback();
         if (!DoCommittedCallbacks(dispatcher))
         {
             CommitListeners();
             CommitImpl();
             CommitClearAll();
         }
         else
         {
             CommitListeners();
             Collection4 deleted = CollectCommittedCallbackDeletedInfo();
             CommitImpl();
             CallbackObjectInfoCollections committedInfo = CollectCommittedCallbackInfo(deleted
                                                                                        );
             CommitClearAll();
             dispatcher.DispatchCommitted(CallbackObjectInfoCollections.Emtpy == committedInfo
                                          ? committedInfo : new CallbackObjectInfoCollections(committedInfo.added, committedInfo
                                                                                              .updated, new ObjectInfoCollectionImpl(deleted)));
         }
     }
 }
Ejemplo n.º 2
0
		public Msg ReplyFromServer()
		{
			IServerMessageDispatcher dispatcher = ServerMessageDispatcher();
			lock (ContainerLock())
			{
				ServerTransaction().Commit(dispatcher);
				committedInfo = dispatcher.CommittedInfo();
			}
			return Msg.Ok;
		}
Ejemplo n.º 3
0
 private byte[] EncodeInfo(CallbackObjectInfoCollections callbackInfo, ByteArrayOutputStream
     os)
 {
     EncodeObjectInfoCollection(os, callbackInfo.added, new InternalIDEncoder
         (this));
     EncodeObjectInfoCollection(os, callbackInfo.deleted, new FrozenObjectInfoEncoder
         (this));
     EncodeObjectInfoCollection(os, callbackInfo.updated, new InternalIDEncoder
         (this));
     return os.ToByteArray();
 }
Ejemplo n.º 4
0
 public virtual MCommittedInfo Encode(CallbackObjectInfoCollections callbackInfo,
     int dispatcherID)
 {
     var os = new ByteArrayOutputStream();
     PrimitiveCodec.WriteInt(os, dispatcherID);
     var bytes = EncodeInfo(callbackInfo, os);
     var committedInfo = (MCommittedInfo) GetWriterForLength(Transaction(),
         bytes.Length + Const4.IntLength);
     committedInfo._payLoad.Append(bytes);
     return committedInfo;
 }
Ejemplo n.º 5
0
		private void AddCommittedInfoMsg(CallbackObjectInfoCollections committedInfo, LocalTransaction
			 serverTransaction)
		{
			lock (ContainerLock())
			{
				Msg.CommittedInfo.SetTransaction(serverTransaction);
				MCommittedInfo message = Msg.CommittedInfo.Encode(committedInfo, ServerMessageDispatcher
					().DispatcherID());
				message.SetMessageDispatcher(ServerMessageDispatcher());
				ServerMessageDispatcher().Server().AddCommittedInfoMsg(message);
			}
		}
Ejemplo n.º 6
0
		public virtual void CommitOnCompleted(Transaction transaction, CallbackObjectInfoCollections
			 objectInfoCollections, bool isOwnCommit)
		{
		}
Ejemplo n.º 7
0
		public virtual void CommitOnStarted(Transaction transaction, CallbackObjectInfoCollections
			 objectInfoCollections)
		{
		}
Ejemplo n.º 8
0
 public _IRunnable_111(MCommittedInfo _enclosing, CallbackObjectInfoCollections callbackInfos
     , int dispatcherID)
 {
     this._enclosing = _enclosing;
     this.callbackInfos = callbackInfos;
     this.dispatcherID = dispatcherID;
 }
Ejemplo n.º 9
0
			public _IRunnable_132(EventRegistryImpl _enclosing, Transaction transaction, CallbackObjectInfoCollections
				 objectInfoCollections, bool isOwnCommit)
			{
				this._enclosing = _enclosing;
				this.transaction = transaction;
				this.objectInfoCollections = objectInfoCollections;
				this.isOwnCommit = isOwnCommit;
			}
Ejemplo n.º 10
0
		public virtual void CommitOnCompleted(Transaction transaction, CallbackObjectInfoCollections
			 objectInfoCollections, bool isOwnCommit)
		{
			if (!(_committed != null))
			{
				return;
			}
			WithExceptionHandlingInCallback(new _IRunnable_132(this, transaction, objectInfoCollections
				, isOwnCommit));
		}
Ejemplo n.º 11
0
			public _IRunnable_121(EventRegistryImpl _enclosing, Transaction transaction, CallbackObjectInfoCollections
				 objectInfoCollections)
			{
				this._enclosing = _enclosing;
				this.transaction = transaction;
				this.objectInfoCollections = objectInfoCollections;
			}
Ejemplo n.º 12
0
		public virtual void CommitOnStarted(Transaction transaction, CallbackObjectInfoCollections
			 objectInfoCollections)
		{
			if (!(_committing != null))
			{
				return;
			}
			WithExceptionHandlingInCallback(new _IRunnable_121(this, transaction, objectInfoCollections
				));
		}
Ejemplo n.º 13
0
 public void DispatchCommitted(CallbackObjectInfoCollections committedInfo)
 {
     _enclosing.Callbacks().CommitOnCompleted(_enclosing, committedInfo, false
         );
 }
		public void DispatchCommitted(CallbackObjectInfoCollections committedInfo)
		{
			_committedInfo = committedInfo;
		}
Ejemplo n.º 15
0
		public CommitEventArgs(Transaction transaction, CallbackObjectInfoCollections collections
			, bool isOwnCommit) : base(transaction)
		{
			_collections = collections;
			_isOwnCommit = isOwnCommit;
		}
Ejemplo n.º 16
0
 public void DispatchCommitted(CallbackObjectInfoCollections committedInfo)
 {
     this._enclosing.Callbacks().CommitOnCompleted(this._enclosing, committedInfo, false
                                                   );
 }