Esempio n. 1
0
 // FIXME: This code has not been called in any test case when the
 //        new ArrayMarshaller was written.
 //        Apparently it only frees slots.
 //        For now the code simply returns without freeing.
 /// <param name="classPrimitive"></param>
 public void DeletePrimitiveEmbedded(StatefulBuffer buffer, PrimitiveTypeMetadata
                                     classPrimitive)
 {
     buffer.ReadInt();
     //int address = a_bytes.readInt();
     buffer.ReadInt();
 }
Esempio n. 2
0
 /// <summary>This readIndexEntry method reads from the parent slot.</summary>
 /// <remarks>This readIndexEntry method reads from the parent slot.</remarks>
 /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public virtual object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer
     buffer)
 {
     var payLoadOffSet = buffer.ReadInt();
     var length = buffer.ReadInt();
     if (payLoadOffSet == 0)
     {
         return null;
     }
     return buffer.ReadPayloadWriter(payLoadOffSet, length);
 }
Esempio n. 3
0
        /// <summary>This readIndexEntry method reads from the parent slot.</summary>
        /// <remarks>This readIndexEntry method reads from the parent slot.</remarks>
        /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
        /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
        public virtual object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer
                                                           buffer)
        {
            int payLoadOffSet = buffer.ReadInt();
            int length        = buffer.ReadInt();

            if (payLoadOffSet == 0)
            {
                return(null);
            }
            return(buffer.ReadPayloadWriter(payLoadOffSet, length));
        }
Esempio n. 4
0
        public void ProcessAtServer()
        {
            IServerMessageDispatcher dispatcher = (IServerMessageDispatcher)MessageDispatcher
                                                      ();
            int         count = ReadInt();
            Transaction ta    = Transaction();

            for (int i = 0; i < count; i++)
            {
                StatefulBuffer writer        = _payLoad.ReadStatefulBuffer();
                int            messageId     = writer.ReadInt();
                Msg            message       = Msg.GetMessage(messageId);
                Msg            clonedMessage = message.PublicClone();
                clonedMessage.SetMessageDispatcher(MessageDispatcher());
                clonedMessage.SetTransaction(ta);
                if (clonedMessage is MsgD)
                {
                    MsgD msgd = (MsgD)clonedMessage;
                    msgd.PayLoad(writer);
                    if (msgd.PayLoad() != null)
                    {
                        msgd.PayLoad().IncrementOffset(Const4.IntLength);
                        Transaction t = CheckParentTransaction(ta, msgd.PayLoad());
                        msgd.SetTransaction(t);
                        dispatcher.ProcessMessage(msgd);
                    }
                }
                else
                {
                    dispatcher.ProcessMessage(clonedMessage);
                }
            }
        }
Esempio n. 5
0
        /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
        public static Db4objects.Db4o.CS.Internal.Messages.Msg ReadMessage(IMessageDispatcher
                                                                           messageDispatcher, Db4objects.Db4o.Internal.Transaction trans, Socket4Adapter socket
                                                                           )
        {
            StatefulBuffer reader = ReadMessageBuffer(trans, socket);

            Db4objects.Db4o.CS.Internal.Messages.Msg message = _messages[reader.ReadInt()].ReadPayLoad
                                                                   (messageDispatcher, trans, socket, reader);
            return(message);
        }
 public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2
     )
 {
     if (transactionId1 <= 0 || transactionId1 != transactionId2)
     {
         return;
     }
     var bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1
         , Const4.IntLength);
     bytes.Read();
     var length = bytes.ReadInt();
     if (length > 0)
     {
         bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1, length
             );
         bytes.Read();
         bytes.IncrementOffset(Const4.IntLength);
         ReadWriteSlotChanges(bytes);
     }
     _container.WriteTransactionPointer(0);
     FlushDatabaseFile();
 }
Esempio n. 7
0
        public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2
                                                            )
        {
            if (transactionId1 <= 0 || transactionId1 != transactionId2)
            {
                return;
            }
            StatefulBuffer bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1
                                                      , Const4.IntLength);

            bytes.Read();
            int length = bytes.ReadInt();

            if (length > 0)
            {
                bytes = new StatefulBuffer(_container.SystemTransaction(), transactionId1, length
                                           );
                bytes.Read();
                bytes.IncrementOffset(Const4.IntLength);
                ReadWriteSlotChanges(bytes);
            }
            _container.WriteTransactionPointer(0);
            FlushDatabaseFile();
        }
Esempio n. 8
0
 public int ReadInt()
 {
     return(_payLoad.ReadInt());
 }
Esempio n. 9
0
 /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public override object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer
                                                     buffer)
 {
     return(buffer.Container().ReadWriterByAddress(buffer.Transaction(), buffer.ReadInt
                                                       (), buffer.ReadInt()));
 }
Esempio n. 10
0
 public object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer)
 {
     return(new IndexEntry(statefulBuffer.ReadInt(), statefulBuffer.ReadLong()));
 }
Esempio n. 11
0
 /// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public override object ReadIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer
     buffer)
 {
     return buffer.Container().ReadWriterByAddress(buffer.Transaction(), buffer.ReadInt
         (), buffer.ReadInt());
 }
Esempio n. 12
0
 // FIXME: This code has not been called in any test case when the 
 //        new ArrayMarshaller was written.
 //        Apparently it only frees slots.
 //        For now the code simply returns without freeing.
 /// <param name="classPrimitive"></param>
 public void DeletePrimitiveEmbedded(StatefulBuffer buffer, PrimitiveTypeMetadata
     classPrimitive)
 {
     buffer.ReadInt();
     //int address = a_bytes.readInt();
     buffer.ReadInt();
 }