@Override protected final <T> RunnableFuture<T> newTaskFor(final Runnable runnable, final T value) { final RunnableFuture<T> task = super.newTaskFor(runnable, value); futures.add(task); return task; }
@Override protected final <T> RunnableFuture<T> newTaskFor(final Callable<T> callable) { final RunnableFuture<T> task = super.newTaskFor(callable); futures.add(task); return task; }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { RunnableFuture<T> runnableFuture = super.newTaskFor(runnable, value); tasks.put(runnableFuture, runnable); return runnableFuture; }
return super.newTaskFor(callable);
protected <T extends Object> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (callable instanceof Job) { return new Task((Job) callable); } return super.newTaskFor(callable); };
/** * Ensure that we give out our EjbFutureTask as opposed to JDK's FutureTask * @param callable * @return a RunnableFuture */ @Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (callable instanceof EjbAsyncTask) { return ((EjbAsyncTask) callable).getFutureTask(); } return super.newTaskFor(callable); }
protected <T extends Object> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (callable instanceof Job) { return new Task((Job) callable); } return super.newTaskFor(callable); };
@Override protected <T> RunnableFuture<T> newTaskFor(final Runnable runnable, final T value) { final RunnableFuture<T> future = super.newTaskFor(runnable, value); if (runnable instanceof NodeTaskWrapper) ((NodeTaskWrapper) runnable).setFuture(future); return future; } };
/** * Overrides {@link ThreadPoolExecutor} to return our own instance of * {@link FutureTask} so that we have a marker for when the background * activity is completed in {@link #afterExecute(Runnable, Throwable)}. * * Overriding this method is somewhat non-standard. */ @Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (callable instanceof BackgroundCallable) { BackgroundCallable<?> background = (BackgroundCallable<?>) callable; return new BackgroundFutureTask(background.delegate); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { RunnableFuture<T> newTaskFor = super.newTaskFor(callable); return new PriorityFuture<T>(newTaskFor, ((PriorityCallable<T>) callable).getPriority()); } };
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof TraceSessionWrapper)) { return new TraceSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof TraceSessionWrapper)) { return new TraceSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected RunnableFuture newTaskFor(Callable callable) { if (callable instanceof PathDetectionTask) { return ((PathDetectionTask) callable).newTask(); } else { return super.newTaskFor(callable); // A regular Callable, delegate to parent } } }
@Override protected RunnableFuture newTaskFor(Callable callable) { if (callable instanceof PathDetectionTask) { return ((PathDetectionTask) callable).newTask(); } else { return super.newTaskFor(callable); // A regular Callable, delegate to parent } } }