Spring Framework ListenableFutureTask - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ListenableFutureTask class.

This code example shows how to use the following methods:
	} 
 
	@Override 
	public ListenableFuture<?> submitListenable(Runnable task) {
		try { 
			ListenableFutureTask<Object> future = new ListenableFutureTask<Object>(task, null);
			this.concurrentExecutor.execute(future);
			return future;
		} 
		catch (RejectedExecutionException ex) {
			throw new TaskRejectedException(
					"Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
		} 
	} 
 
	@Override 
	public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
		try { 
			ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
			this.concurrentExecutor.execute(future);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		return future;
	} 
 
	@Override 
	public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
		ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
		execute(future);
		return future;
	} 
 
	/** 
	 * This task executor prefers short-lived work units. 
	 */ 
	@Override 
	public boolean prefersShortLivedTasks() { 
		return true; 
	} 
 
 
	@Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	@Override 
	public ListenableFuture<?> submitListenable(Runnable task) {
		ExecutorService executor = getThreadPoolExecutor();
		try { 
			ListenableFutureTask<Object> future = new ListenableFutureTask<Object>(task, null);
			executor.execute(future);
			return future;
		} 
		catch (RejectedExecutionException ex) {
			throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
		} 
	} 
 
	@Override 
	public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
		ExecutorService executor = getThreadPoolExecutor();
		try { 
			ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
			executor.execute(future);
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		return future;
	} 
 
	@Override 
	public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
		ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
		execute(future);
		return future;
	} 
 
	/** 
	 * This task executor prefers short-lived work units. 
	 */ 
	@Override 
	public boolean prefersShortLivedTasks() { 
		return true; 
	} 
 
 
	//------------------------------------------------------------------------- 
5
CodeRank
Experience pair programming with AI  Get Codota for Java