Пример #1
0
        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
 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
 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;
 }