public BaseContainer() { this.managedExecutorService = lookupManagedExecutorService(); this.managedScheduledExecutorService = lookupManagedScheduledExecutorService(); if (managedExecutorService == null || managedScheduledExecutorService == null) { // at least one of the managed executor services is null, a local one will be created instead threadFactory = new DaemonThreadFactory(); } else { // only managed executor services will be used, the thread factory won't be needed. threadFactory = null; } }
/** * Release executor services managed by this instance if the condition passed in the parameter is fulfilled. * Executor services obtained via JNDI lookup won't be shut down. * * @param shutDownCondition condition that will be evaluated before executor services are released and they will be * released only if the condition is evaluated to {@code true}. The condition will be * evaluated in a synchronized block in order to make the process of its evaluation * and executor services release an atomic operation. */ protected void shutdown(ShutDownCondition shutDownCondition) { synchronized (EXECUTORS_CLEAN_UP_LOCK) { if (shutDownCondition.evaluate()) { shutdown(); } } }
ExecutorService executor = ((BaseContainer) sessions.get(0).getValue().getContainer()).getExecutorService(); Map<Future<Map<Session, Future<?>>>, int[]> submitFutures = new HashMap<Future<Map<Session, Future<?>>>, int[]>();
ExecutorService executor = ((BaseContainer) sessions.get(0).getValue().getContainer()).getExecutorService(); Map<Future<Map<Session, Future<?>>>, int[]> submitFutures = new HashMap<Future<Map<Session, Future<?>>>, int[]>();
public BaseContainer() { this.managedExecutorService = lookupManagedExecutorService(); this.managedScheduledExecutorService = lookupManagedScheduledExecutorService(); if (managedExecutorService == null || managedScheduledExecutorService == null) { // at least one of the managed executor services is null, a local one will be created instead threadFactory = new DaemonThreadFactory(); } else { // only managed executor services will be used, the thread factory won't be needed. threadFactory = null; } }
if (buffer == null) { buffer = new ReaderBuffer(((BaseContainer) container).getExecutorService()); session.setReaderBuffer(buffer);
/** * Release executor services managed by this instance if the condition passed in the parameter is fulfilled. * Executor services obtained via JNDI lookup won't be shut down. * * @param shutDownCondition condition that will be evaluated before executor services are released and they will be * released only if the condition is evaluated to {@code true}. The condition will be * evaluated in a synchronized block in order to make the process of its evaluation * and executor services release an atomic operation. */ protected void shutdown(ShutDownCondition shutDownCondition) { synchronized (EXECUTORS_CLEAN_UP_LOCK) { if (shutDownCondition.evaluate()) { shutdown(); } } }
if (buffer == null) { buffer = new InputStreamBuffer(((BaseContainer) container).getExecutorService()); session.setInputStreamBuffer(buffer);
if (buffer == null) { buffer = new InputStreamBuffer(((BaseContainer) container).getExecutorService()); session.setInputStreamBuffer(buffer);
if (buffer == null) { buffer = new ReaderBuffer(((BaseContainer) container).getExecutorService()); session.setReaderBuffer(buffer);