示例#1
0
文件: Buffer.cs 项目: xingx001/ice
        private void reserve(int n)
        {
            Debug.Assert(_capacity == b.capacity());

            if (n > _capacity)
            {
                _capacity = System.Math.Max(n, 2 * _capacity);
                _capacity = System.Math.Max(240, _capacity);
            }
            else if (n < _capacity)
            {
                _capacity = n;
            }
            else
            {
                return;
            }

            try
            {
                ByteBuffer buf = ByteBuffer.allocate(_capacity);

                if (b == _emptyBuffer)
                {
                    b = buf;
                }
                else
                {
                    int pos = b.position();
                    b.position(0);
                    b.limit(System.Math.Min(_capacity, b.capacity()));
                    buf.put(b);
                    b = buf;
                    b.limit(b.capacity());
                    b.position(pos);
                }

                b.order(_order);
            }
            catch (System.OutOfMemoryException)
            {
                _capacity = b.capacity(); // Restore the previous capacity
                throw;
            }
            catch (System.Exception ex)
            {
                _capacity = b.capacity(); // Restore the previous capacity.
                Ice.MarshalException e = new Ice.MarshalException(ex);
                e.reason = "unexpected exception while trying to allocate a ByteBuffer:\n" + ex;
                throw e;
            }
            finally
            {
                Debug.Assert(_capacity == b.capacity());
            }
        }
示例#2
0
 public static void checkMode__(OperationMode expected, OperationMode received)
 {
     if (expected != received)
     {
         if (expected == OperationMode.Idempotent && received == OperationMode.Nonmutating)
         {
             //
             // Fine: typically an old client still using the
             // deprecated nonmutating keyword
             //
         }
         else
         {
             Ice.MarshalException ex = new Ice.MarshalException();
             ex.reason = "unexpected operation mode. expected = " + operationModeToString(expected) +
                         " received = " + operationModeToString(received);
             throw ex;
         }
     }
 }
示例#3
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type Murmur::ServerContextCallback was not generated with stream support";
     throw ex;
 }
示例#4
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type Streamer::BitmapProvider was not generated with stream support";
     throw ex;
 }
示例#5
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type MCS::UserManagement was not generated with stream support";
     throw ex;
 }
示例#6
0
        private void reserve(int n)
        {
            Debug.Assert(_capacity == b.capacity());

            if(n > _capacity)
            {
                _capacity = System.Math.Max(n, System.Math.Min(2 * _capacity, _maxCapacity));
                _capacity = System.Math.Max(240, _capacity);
            }
            else if(n < _capacity)
            {
                _capacity = n;
            }
            else
            {
                return;
            }

            try
            {
                ByteBuffer buf = ByteBuffer.allocate(_capacity);

                if(b == _emptyBuffer)
                {
                    b = buf;
                }
                else
                {
                    int pos = b.position();
                    b.position(0);
                    b.limit(System.Math.Min(_capacity, b.capacity()));
                    buf.put(b);
                    b = buf;
                    b.limit(b.capacity());
                    b.position(pos);
                }

                b.order(ByteBuffer.ByteOrder.LITTLE_ENDIAN);
            }
            catch(System.OutOfMemoryException)
            {
                _capacity = b.capacity(); // Restore the previous capacity
                throw;
            }
            catch(System.Exception ex)
            {
                _capacity = b.capacity(); // Restore the previous capacity.
                Ice.MarshalException e = new Ice.MarshalException(ex);
                e.reason = "unexpected exception while trying to allocate a ByteBuffer:\n" + ex;
                throw e;
            }
            finally
            {
                Debug.Assert(_capacity == b.capacity());
            }
        }
示例#7
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type RepoIce::RepoApi was not generated with stream support";
     throw ex;
 }
示例#8
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception Murmur::InvalidChannelException was not generated with stream support";
     throw ex;
 }
示例#9
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type vsm::network::VSServer was not generated with stream support";
     throw ex;
 }
示例#10
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception vsm::network::AlreadyConnectedException was not generated with stream support";
     throw ex;
 }
示例#11
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception vsm::network::AlreadyConnectedException was not generated with stream support";
     throw ex;
 }
示例#12
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type vsm::component::VSTransform was not generated with stream support";
     throw ex;
 }
示例#13
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type vsm::component::VSTransform was not generated with stream support";
     throw ex;
 }
示例#14
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception Chat::IllegalChatSessionException was not generated with stream support";
     throw ex;
 }
示例#15
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception Chat::IllegalChatSessionException was not generated with stream support";
     throw ex;
 }
示例#16
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type Murmur::ServerContextCallback was not generated with stream support";
     throw ex;
 }
示例#17
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type Murmur::ServerUpdatingAuthenticator was not generated with stream support";
     throw ex;
 }
示例#18
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type vsm::network::VSServer was not generated with stream support";
     throw ex;
 }
示例#19
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception Murmur::InvalidChannelException was not generated with stream support";
     throw ex;
 }
示例#20
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type MCS::FoupMove was not generated with stream support";
     throw ex;
 }
示例#21
0
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type RepoIce::RepoApi was not generated with stream support";
     throw ex;
 }
示例#22
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type MCS::FoupMove was not generated with stream support";
     throw ex;
 }
示例#23
0
文件: KeeICE.cs 项目: hathagat/KeeFox
 public override void write__(Ice.OutputStream outS__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception KeeICE::KPlib::KeeICEException was not generated with stream support";
     throw ex;
 }
示例#24
0
文件: KeeICE.cs 项目: hathagat/KeeFox
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "exception KeeICE::KPlib::KeeICEException was not generated with stream support";
     throw ex;
 }
示例#25
0
 protected static void checkMode__(OperationMode expected, OperationMode received)
 {
     if(expected != received)
     {
         if(expected == OperationMode.Idempotent && received == OperationMode.Nonmutating)
         {
             //
             // Fine: typically an old client still using the
             // deprecated nonmutating keyword
             //
         }
         else
         {
             Ice.MarshalException ex = new Ice.MarshalException();
             ex.reason = "unexpected operation mode. expected = " + operationModeToString(expected) +
                 " received = " + operationModeToString(received);
             throw ex;
         }
     }
 }
示例#26
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type InfoDTV::Multiplexer::Dynamic::Provider::BufferTransfer was not generated with stream support";
     throw ex;
 }
示例#27
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type MCS::UserManagement was not generated with stream support";
     throw ex;
 }
示例#28
0
 public override void read__(Ice.InputStream inS__, bool rid__)
 {
     Ice.MarshalException ex = new Ice.MarshalException();
     ex.reason = "type Streamer::BitmapProvider was not generated with stream support";
     throw ex;
 }