public void stop() {
final ScheduledExecutorService scheduler = this.scheduler.get();
if (scheduler != null && this.scheduler.compareAndSet(scheduler, null)) {
scheduler.shutdown();
try {
if (!scheduler.awaitTermination(10000, MILLISECONDS)) {
java.util.logging.Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Pool scheduler termination timeout expired");
}
} catch (InterruptedException e) {
//Ignore
}