kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b8c8c820ec5e477e5c4724e83a7903f03f40a7615c9be53f2c072b4a2c405cf6 |
|---|---|
| Author | Sylvain Lebresne <sylvain@datastax.com> · 2014-03-03 17:44 +01:00 |
| Committer | Sylvain Lebresne <sylvain@datastax.com> · 2014-03-03 17:44 +01:00 |
| Parents | 4f5170099e87 |
4 files changed
modified driver-core/CHANGELOG.rst +5 −0
| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | CHANGELOG |
| 2 | 2 | ========= |
| 3 | 3 | |
| 4 | +1.0.7: | |
| 5 | +------ | |
| 6 | + | |
| 7 | +- [new] Add method to check if a Cluster/Session instance has been closed already (JAVA-114) | |
| 8 | + | |
| 4 | 9 | 1.0.6: |
| 5 | 10 | ------ |
| 6 | 11 |
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +10 −0
| @@ -305,6 +305,16 @@ | ||
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | + /** | |
| 309 | + * Whether shutdown has been called on this Cluster instance. | |
| 310 | + * | |
| 311 | + * @return {@code true} if {@code shutdown} has been called on this instance, | |
| 312 | + * {@code false} otherwise. | |
| 313 | + */ | |
| 314 | + public boolean isShutdown() { | |
| 315 | + return manager.isShutdown.get(); | |
| 316 | + } | |
| 317 | + | |
| 308 | 318 | /** |
| 309 | 319 | * Initializer for {@link Cluster} instances. |
| 310 | 320 | * <p> |
modified driver-core/src/main/java/com/datastax/driver/core/Session.java +7 −0
| @@ -228,6 +228,13 @@ | ||
| 228 | 228 | */ |
| 229 | 229 | public boolean shutdown(long timeout, TimeUnit unit); |
| 230 | 230 | |
| 231 | + /** | |
| 232 | + * Whether shutdown has been called on this Session instance. | |
| 233 | + * | |
| 234 | + * @return {@code true} if this instance is shut down, {@code false} otherwise. | |
| 235 | + */ | |
| 236 | + public boolean isShutdown(); | |
| 237 | + | |
| 231 | 238 | /** |
| 232 | 239 | * Returns the {@code Cluster} object this session is part of. |
| 233 | 240 | * |
modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +4 −0
| @@ -155,6 +155,10 @@ | ||
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | + public boolean isShutdown() { | |
| 159 | + return isShutdown.get(); | |
| 160 | + } | |
| 161 | + | |
| 158 | 162 | public Cluster getCluster() { |
| 159 | 163 | return cluster; |
| 160 | 164 | } |