JBoss Data Grid HotRod C++ Client  6.6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ConnectionPoolConfigurationBuilder.h
Go to the documentation of this file.
1 #ifndef CONNECTIONPOOLCONFIGURATIONBUILDER_H_
2 #define CONNECTIONPOOLCONFIGURATIONBUILDER_H_
3 
5 #include "Builder.h"
7 
8 namespace infinispan {
9 namespace hotrod {
10 
17  : public Builder<ConnectionPoolConfiguration>, public ConfigurationChildBuilder
18 {
19  public:
22  m_exhaustedAction(WAIT),
23  m_lifo(true),
24  m_maxActive(8),
25  m_maxTotal(-1),
26  m_maxWait(-1),
27  m_maxIdle(8),
28  m_minIdle(0),
29  m_numTestsPerEvictionRun(3),
30  m_timeBetweenEvictionRuns(120000),
31  m_minEvictableIdleTime(1000l * 60l * 30l),
32  m_testOnBorrow(false),
33  m_testOnReturn(false),
34  m_testWhileIdle(true) {}
35 
43  m_exhaustedAction = exhaustedAction_;
44  return *this;
45  }
46 
56  m_lifo = lifo_;
57  return *this;
58  }
59 
70  m_maxActive = maxActive_;
71  return *this;
72  }
73 
83  m_maxTotal = maxTotal_;
84  return *this;
85  }
86 
95  m_maxWait = maxWait_;
96  return *this;
97  }
98 
107  m_maxIdle = maxIdle_;
108  return *this;
109  }
110 
121  m_minIdle = minIdle_;
122  return *this;
123  }
124 
132  m_numTestsPerEvictionRun = numTestsPerEvictionRun_;
133  return *this;
134  }
135 
144  m_timeBetweenEvictionRuns = timeBetweenEvictionRuns_;
145  return *this;
146  }
147 
158  m_minEvictableIdleTime = minEvictableIdleTime_;
159  return *this;
160  }
161 
170  m_testOnBorrow = testOnBorrow_;
171  return *this;
172  }
173 
182  m_testOnReturn = testOnReturn_;
183  return *this;
184  }
185 
195  m_testWhileIdle = testWhileIdle_;
196  return *this;
197  }
198 
201  m_exhaustedAction,
202  m_lifo,
203  m_maxActive,
204  m_maxTotal,
205  m_maxWait,
206  m_maxIdle,
207  m_minIdle,
208  m_numTestsPerEvictionRun,
209  m_timeBetweenEvictionRuns,
210  m_minEvictableIdleTime,
211  m_testOnBorrow,
212  m_testOnReturn,
213  m_testWhileIdle);
214  }
216  // FIXME: implement
217  (void) configuration;
218  return *this;
219  }
220 
221  private:
222  ExhaustedAction m_exhaustedAction;
223  bool m_lifo;
224  int m_maxActive;
225  int m_maxTotal;
226  long m_maxWait;
227  int m_maxIdle;
228  int m_minIdle;
229  int m_numTestsPerEvictionRun;
230  int m_timeBetweenEvictionRuns;
231  int m_minEvictableIdleTime;
232  bool m_testOnBorrow;
233  bool m_testOnReturn;
234  bool m_testWhileIdle;
235 };
236 
237 }} //namespace
238 #endif /* CONNECTIONPOOLCONFIGURATIONBUILDER_H_ */
ConnectionPoolConfigurationBuilder & testOnReturn(bool testOnReturn_)
Definition: ConnectionPoolConfigurationBuilder.h:181
ConnectionPoolConfigurationBuilder & maxActive(int maxActive_)
Definition: ConnectionPoolConfigurationBuilder.h:69
ConnectionPoolConfigurationBuilder & maxTotal(int maxTotal_)
Definition: ConnectionPoolConfigurationBuilder.h:82
ConnectionPoolConfigurationBuilder(ConfigurationBuilder &builder)
Definition: ConnectionPoolConfigurationBuilder.h:20
ConnectionPoolConfigurationBuilder & timeBetweenEvictionRuns(int timeBetweenEvictionRuns_)
Definition: ConnectionPoolConfigurationBuilder.h:143
Definition: ConnectionPoolConfigurationBuilder.h:16
Definition: Builder.h:15
ConnectionPoolConfigurationBuilder & maxWait(long maxWait_)
Definition: ConnectionPoolConfigurationBuilder.h:94
ConnectionPoolConfigurationBuilder & exhaustedAction(ExhaustedAction exhaustedAction_)
Definition: ConnectionPoolConfigurationBuilder.h:42
ConnectionPoolConfigurationBuilder & maxIdle(int maxIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:106
virtual ConnectionPoolConfiguration create()
Definition: ConnectionPoolConfigurationBuilder.h:199
Definition: ConnectionPoolConfiguration.h:14
ConnectionPoolConfigurationBuilder & testOnBorrow(bool testOnBorrow_)
Definition: ConnectionPoolConfigurationBuilder.h:169
Definition: ConfigurationBuilder.h:27
Definition: ConfigurationChildBuilder.h:18
ConnectionPoolConfigurationBuilder & minIdle(int minIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:120
ConnectionPoolConfigurationBuilder & lifo(bool lifo_)
Definition: ConnectionPoolConfigurationBuilder.h:55
ExhaustedAction
Definition: ConnectionPoolConfiguration.h:14
Definition: ConnectionPoolConfiguration.h:21
virtual ConnectionPoolConfigurationBuilder & read(ConnectionPoolConfiguration &configuration)
Definition: ConnectionPoolConfigurationBuilder.h:215
ConnectionPoolConfigurationBuilder & numTestsPerEvictionRun(int numTestsPerEvictionRun_)
Definition: ConnectionPoolConfigurationBuilder.h:131
ConnectionPoolConfigurationBuilder & minEvictableIdleTime(int minEvictableIdleTime_)
Definition: ConnectionPoolConfigurationBuilder.h:157
ConnectionPoolConfigurationBuilder & testWhileIdle(bool testWhileIdle_)
Definition: ConnectionPoolConfigurationBuilder.h:194