void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
/** * Starts the server. */ protected boolean shouldStart() { try { ServerSocket serverSocket = getServerSocketFactory().createServerSocket(getPort(), getBacklog(), getInetAddress()); ServerListener<RemoteAppenderClient> listener = createServerListener(serverSocket); runner = createServerRunner(listener, getContext().getExecutorService()); runner.setContext(getContext()); return true; } catch (Exception ex) { addError("server startup error: " + ex, ex); CloseUtil.closeQuietly(serverSocket); return false; } }
private Future<Socket> activateConnector(SocketConnector connector) { try { return getContext().getExecutorService().submit(connector); } catch (RejectedExecutionException ex) { return null; } }
private Future<Socket> activateConnector(SocketConnector connector) { try { return getContext().getExecutorService().submit(connector); } catch (RejectedExecutionException ex) { return null; } }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
/** * {@inheritDoc} */ public final void start() { if (isStarted()) return; if (getContext() == null) { throw new IllegalStateException("context not set"); } if (shouldStart()) { getContext().getExecutorService().execute(getRunnableTask()); started = true; } }
@Override public void start() { if (isStarted()) return; try { ServerSocket socket = getServerSocketFactory().createServerSocket( getPort(), getBacklog(), getInetAddress()); ServerListener<RemoteReceiverClient> listener = createServerListener(socket); runner = createServerRunner(listener, getContext().getExecutorService()); runner.setContext(getContext()); getContext().getExecutorService().execute(runner); super.start(); } catch (Exception ex) { addError("server startup error: " + ex, ex); } }
queue = newBlockingQueue(queueSize); peerId = "remote peer " + remoteHost + ":" + port + ": "; task = getContext().getExecutorService().submit(this); super.start();
/** * Starts the server. */ protected boolean shouldStart() { try { ServerSocket serverSocket = getServerSocketFactory().createServerSocket( getPort(), getBacklog(), getInetAddress()); ServerListener<RemoteAppenderClient> listener = createServerListener(serverSocket); runner = createServerRunner(listener, getContext().getExecutorService()); runner.setContext(getContext()); return true; } catch (Exception ex) { addError("server startup error: " + ex, ex); CloseUtil.closeQuietly(serverSocket); return false; } }
context.getExecutorService().execute(senderRunnable); } else {
@Override public void execute(Runnable command) { contextAware.getContext().getExecutorService().execute(command); } }
@Override public void shutdown() { contextAware.getContext().getExecutorService().shutdown(); }
@Override public Future<?> submit(Runnable task) { return contextAware.getContext().getExecutorService().submit(task); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return contextAware.getContext().getExecutorService().invokeAny(tasks, timeout, unit); }
@Override public List<Runnable> shutdownNow() { return contextAware.getContext().getExecutorService().shutdownNow(); }
@Override public boolean isTerminated() { return contextAware.getContext().getExecutorService().isTerminated(); }
@Override public boolean isShutdown() { return contextAware.getContext().getExecutorService().isShutdown(); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return contextAware.getContext().getExecutorService().invokeAll(tasks, timeout, unit); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return contextAware.getContext().getExecutorService().invokeAny(tasks); }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }