private void unregister(GroupListener listener) { ExecutorService executor = this.listeners.remove(listener); if (executor != null) { PrivilegedAction<List<Runnable>> action = () -> executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
private void shutdown(ExecutorService executor) { PrivilegedAction<List<Runnable>> action = () -> executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
@Override public Duration getStopTimeout() { return Duration.ofMillis(this.cache.getCacheConfiguration().transaction().cacheStopTimeout()); }
@Override public void close() { this.cache.removeListener(this); PrivilegedAction<List<Runnable>> action = () -> this.executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { this.executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } this.dispatcher.close(); this.scheduler.close(); }
@Override public void stop() { this.groupFactory.close(); this.cache.removeListener(this); PrivilegedAction<List<Runnable>> action = () -> this.executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { this.executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { if (this.dispatcher != null) { this.dispatcher.close(); } this.scheduler.close(); this.affinity.stop(); } }
WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt();
private void unregister(GroupListener listener) { ExecutorService executor = this.listeners.remove(listener); if (executor != null) { PrivilegedAction<List<Runnable>> action = () -> executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
private void shutdown(ExecutorService executor) { PrivilegedAction<List<Runnable>> action = () -> executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
@Override public void stop() { this.groupFactory.close(); this.cache.removeListener(this); PrivilegedAction<List<Runnable>> action = () -> this.executor.shutdownNow(); WildFlySecurityManager.doUnchecked(action); try { this.executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { this.dispatcher.close(); this.scheduler.close(); this.affinity.stop(); } }
WildFlySecurityManager.doUnchecked(action); try { executor.awaitTermination(this.cache.getCacheConfiguration().transaction().cacheStopTimeout(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt();
assertEquals(10000, c.transaction().cacheStopTimeout()); assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode()); assertTrue(!c.transaction().autoCommit());
assertEquals(60000, c.transaction().cacheStopTimeout()); assertEquals(20000, c.memory().size()); assertEquals(10000, c.expiration().wakeUpInterval()); assertEquals(60500, c.transaction().cacheStopTimeout()); assertEquals(20500, c.memory().size()); assertEquals(10500, c.expiration().wakeUpInterval()); assertEquals(61000, c.transaction().cacheStopTimeout()); assertEquals(21000, c.memory().size()); assertEquals(11000, c.expiration().wakeUpInterval()); assertEquals(61500, c.transaction().cacheStopTimeout()); assertEquals(21500, c.memory().size()); assertEquals(11500, c.expiration().wakeUpInterval());