コード例 #1
0
        public override bool Equals(Object obj)
        {
            if (obj is ObjectPoolConfiguration)
            {
                ObjectPoolConfiguration other = (ObjectPoolConfiguration)obj;

                if (MaxObjects != other.MaxObjects)
                {
                    return(false);
                }
                if (MaxIdle != other.MaxIdle)
                {
                    return(false);
                }
                if (MaxWait != other.MaxWait)
                {
                    return(false);
                }
                if (MinEvictableIdleTimeMillis != other.MinEvictableIdleTimeMillis)
                {
                    return(false);
                }
                if (MinIdle != other.MinIdle)
                {
                    return(false);
                }
                return(true);
            }
            return(false);
        }
コード例 #2
0
 public ObjectPoolConfiguration(ObjectPoolConfiguration other)
 {
     this.MaxObjects = other.MaxObjects;
     this.MaxIdle = other.MaxIdle;
     this.MaxWait = other.MaxWait;
     this.MinEvictableIdleTimeMillis = other.MinEvictableIdleTimeMillis;
     this.MinIdle = other.MinIdle;
 }
コード例 #3
0
 public ObjectPoolConfiguration(ObjectPoolConfiguration other)
 {
     this.MaxObjects = other.MaxObjects;
     this.MaxIdle    = other.MaxIdle;
     this.MaxWait    = other.MaxWait;
     this.MinEvictableIdleTimeMillis = other.MinEvictableIdleTimeMillis;
     this.MinIdle = other.MinIdle;
 }
コード例 #4
0
        public APIConfigurationImpl(APIConfigurationImpl other)
        {
            if (null != other._connectorPoolConfiguration)
            {
                ConnectorPoolConfiguration = new ObjectPoolConfiguration(other._connectorPoolConfiguration);
            }
            if (null != other._resultsHandlerConfiguration)
            {
                ResultsHandlerConfiguration = new ResultsHandlerConfiguration(other._resultsHandlerConfiguration);
            }
            IsConnectorPoolingSupported = other.IsConnectorPoolingSupported;
            ConfigurationPropertiesImpl prop = new ConfigurationPropertiesImpl();
            prop.Properties = ((ConfigurationPropertiesImpl)other.ConfigurationProperties).Properties;
            ConfigurationProperties = prop;

            ProducerBufferSize = other.ProducerBufferSize;
            TimeoutMap = new Dictionary<SafeType<APIOperation>, int>(other.TimeoutMap);
            SupportedOperations = new HashSet<SafeType<APIOperation>>(other.SupportedOperations);

            ConnectorInfo = other.ConnectorInfo;
            ChangeListener = other.ChangeListener;
        }
コード例 #5
0
        public void TestObjectPoolConfiguration()
        {
            ObjectPoolConfiguration v1 = new ObjectPoolConfiguration();
            v1.MaxObjects = 1;
            v1.MaxIdle = 2;
            v1.MaxWait = 3;
            v1.MinEvictableIdleTimeMillis = 4;
            v1.MinIdle = 5;
            ObjectPoolConfiguration v2 =
                (ObjectPoolConfiguration)CloneObject(v1);
            Assert.IsTrue(!Object.ReferenceEquals(v1, v2));

            Assert.AreEqual(v1, v2);

            Assert.AreEqual(1, v2.MaxObjects);
            Assert.AreEqual(2, v2.MaxIdle);
            Assert.AreEqual(3, v2.MaxWait);
            Assert.AreEqual(4, v2.MinEvictableIdleTimeMillis);
            Assert.AreEqual(5, v2.MinIdle);
        }