Red Hat Data Grid HotRod C++ Client  7.2.0
ConnectionPoolConfigurationBuilder.h
Go to the documentation of this file.
1 #ifndef CONNECTIONPOOLCONFIGURATIONBUILDER_H_
2 #define CONNECTIONPOOLCONFIGURATIONBUILDER_H_
3 
6 
7 namespace infinispan {
8 namespace hotrod {
9 
17 {
18  public:
21  m_exhaustedAction(WAIT),
22  m_lifo(true),
23  m_maxActive(8),
24  m_maxTotal(-1),
25  m_maxWait(-1),
26  m_maxIdle(8),
27  m_minIdle(0),
28  m_numTestsPerEvictionRun(3),
29  m_timeBetweenEvictionRuns(120000),
30  m_minEvictableIdleTime(1000l * 60l * 30l),
31  m_testOnBorrow(false),
32  m_testOnReturn(false),
33  m_testWhileIdle(true) {}
34  virtual void validate() {}
36 
44  m_exhaustedAction = exhaustedAction_;
45  return *this;
46  }
47 
57  m_lifo = lifo_;
58  return *this;
59  }
60 
71  m_maxActive = maxActive_;
72  return *this;
73  }
74 
84  m_maxTotal = maxTotal_;
85  return *this;
86  }
87 
96  m_maxWait = maxWait_;
97  return *this;
98  }
99 
108  m_maxIdle = maxIdle_;
109  return *this;
110  }
111 
122  m_minIdle = minIdle_;
123  return *this;
124  }
125 
133  m_numTestsPerEvictionRun = numTestsPerEvictionRun_;
134  return *this;
135  }
136 
145  m_timeBetweenEvictionRuns = timeBetweenEvictionRuns_;
146  return *this;
147  }
148 
159  m_minEvictableIdleTime = minEvictableIdleTime_;
160  return *this;
161  }
162 
171  m_testOnBorrow = testOnBorrow_;
172  return *this;
173  }
174 
183  m_testOnReturn = testOnReturn_;
184  return *this;
185  }
186 
196  m_testWhileIdle = testWhileIdle_;
197  return *this;
198  }
199 
202  m_exhaustedAction,
203  m_lifo,
204  m_maxActive,
205  m_maxTotal,
206  m_maxWait,
207  m_maxIdle,
208  m_minIdle,
209  m_numTestsPerEvictionRun,
210  m_timeBetweenEvictionRuns,
211  m_minEvictableIdleTime,
212  m_testOnBorrow,
213  m_testOnReturn,
214  m_testWhileIdle);
215  }
217  // FIXME: implement
218  (void) configuration;
219  return *this;
220  }
221 
222  private:
223  ExhaustedAction m_exhaustedAction;
224  bool m_lifo;
225  int m_maxActive;
226  int m_maxTotal;
227  long m_maxWait;
228  int m_maxIdle;
229  int m_minIdle;
230  int m_numTestsPerEvictionRun;
231  int m_timeBetweenEvictionRuns;
232  int m_minEvictableIdleTime;
233  bool m_testOnBorrow;
234  bool m_testOnReturn;
235  bool m_testWhileIdle;
236 };
237 
238 }} //namespace
239 #endif /* CONNECTIONPOOLCONFIGURATIONBUILDER_H_ */
ConnectionPoolConfigurationBuilder & testOnReturn(bool testOnReturn_)
Definition: ConnectionPoolConfigurationBuilder.h:182
ConnectionPoolConfigurationBuilder & maxActive(int maxActive_)
Definition: ConnectionPoolConfigurationBuilder.h:70
virtual ~ConnectionPoolConfigurationBuilder()
Definition: ConnectionPoolConfigurationBuilder.h:35
ConnectionPoolConfigurationBuilder & maxTotal(int maxTotal_)
Definition: ConnectionPoolConfigurationBuilder.h:83
ConnectionPoolConfigurationBuilder(ConfigurationBuilder &builder)
Definition: ConnectionPoolConfigurationBuilder.h:19
ConnectionPoolConfigurationBuilder & timeBetweenEvictionRuns(int timeBetweenEvictionRuns_)
Definition: ConnectionPoolConfigurationBuilder.h:144
Definition: ConnectionPoolConfigurationBuilder.h:15
Definition: AuthenticationConfiguration.h:10
ConnectionPoolConfigurationBuilder & maxWait(long maxWait_)
Definition: ConnectionPoolConfigurationBuilder.h:95
ConnectionPoolConfigurationBuilder & exhaustedAction(ExhaustedAction exhaustedAction_)
Definition: ConnectionPoolConfigurationBuilder.h:43
ConnectionPoolConfigurationBuilder & maxIdle(int maxIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:107
virtual ConnectionPoolConfiguration create()
Definition: ConnectionPoolConfigurationBuilder.h:200
Definition: ConnectionPoolConfiguration.h:14
ConnectionPoolConfigurationBuilder & testOnBorrow(bool testOnBorrow_)
Definition: ConnectionPoolConfigurationBuilder.h:170
Definition: ConfigurationBuilder.h:111
Definition: ConfigurationChildBuilder.h:18
ConnectionPoolConfigurationBuilder & minIdle(int minIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:121
ConnectionPoolConfigurationBuilder & lifo(bool lifo_)
Definition: ConnectionPoolConfigurationBuilder.h:56
ExhaustedAction
Definition: ConnectionPoolConfiguration.h:14
Definition: ConnectionPoolConfiguration.h:21
virtual ConnectionPoolConfigurationBuilder & read(ConnectionPoolConfiguration &configuration)
Definition: ConnectionPoolConfigurationBuilder.h:216
ConnectionPoolConfigurationBuilder & numTestsPerEvictionRun(int numTestsPerEvictionRun_)
Definition: ConnectionPoolConfigurationBuilder.h:132
ConnectionPoolConfigurationBuilder & minEvictableIdleTime(int minEvictableIdleTime_)
Definition: ConnectionPoolConfigurationBuilder.h:158
ConnectionPoolConfigurationBuilder & testWhileIdle(bool testWhileIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:195
virtual void validate()
Definition: ConnectionPoolConfigurationBuilder.h:34