Esempio n. 1
0
 /**
  * Shutdown this session instance, only waiting a definite amount of time.
  *
  * <p>This closes all connections used by this sessions. Note that if you want to shutdown the
  * full {@code Cluster} instance this session is part of, you should use {@link Cluster#shutdown}
  * instead (which will call this method for all session but also release some additional
  * resources).
  *
  * <p>Note that this method is not thread safe in the sense that if another shutdown is perform in
  * parallel, it might return {@code true} even if the instance is not yet fully shutdown.
  *
  * @param timeout how long to wait for the session to shutdown.
  * @param unit the unit for the timeout.
  * @return {@code true} if the session has been properly shutdown within the {@code timeout},
  *     {@code false} otherwise.
  */
 public boolean shutdown(long timeout, TimeUnit unit) {
   try {
     return manager.shutdown(timeout, unit);
   } catch (InterruptedException e) {
     Thread.currentThread().interrupt();
     return false;
   }
 }
Esempio n. 2
0
 /**
  * Shutdown this session instance.
  *
  * <p>This closes all connections used by this sessions. Note that if you want to shutdown the
  * full {@code Cluster} instance this session is part of, you should use {@link Cluster#shutdown}
  * instead (which will call this method for all session but also release some additional
  * ressources).
  *
  * <p>This method has no effect if the session was already shutdown.
  */
 public void shutdown() {
   manager.shutdown();
 }