예제 #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
파일: Buffer.cs 프로젝트: Radulfr/zeroc-ice
        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
파일: Object.cs 프로젝트: Radulfr/zeroc-ice
 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;
 }