当前位置: 首页>>代码示例>>Java>>正文


Java TaskRejectedException类代码示例

本文整理汇总了Java中org.springframework.core.task.TaskRejectedException的典型用法代码示例。如果您正苦于以下问题:Java TaskRejectedException类的具体用法?Java TaskRejectedException怎么用?Java TaskRejectedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaskRejectedException类属于org.springframework.core.task包,在下文中一共展示了TaskRejectedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runDeadlockFuture

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
/**
 * Runs deadlock guard task
 *
 * @param deadlockGuardTask
 *            deadlock guard task
 */
@SuppressWarnings("unchecked")
public void runDeadlockFuture(Runnable deadlockGuardTask) {
    if (deadlockFuture == null) {
        ThreadPoolTaskScheduler deadlockGuard = conn.getDeadlockGuardScheduler();
        if (deadlockGuard != null) {
            try {
                deadlockFuture = (ScheduledFuture<Runnable>) deadlockGuard.schedule(deadlockGuardTask, new Date(packet.getExpirationTime()));
            } catch (TaskRejectedException e) {
                log.warn("DeadlockGuard task is rejected for {}", sessionId, e);
            }
        } else {
            log.debug("Deadlock guard is null for {}", sessionId);
        }
    } else {
        log.warn("Deadlock future is already create for {}", sessionId);
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:24,代码来源:ReceivedMessageTask.java

示例2: submitListenable

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@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);
   }
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:18,代码来源:FairThreadPoolTaskExecutor.java

示例3: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public Future<?> submit(Runnable task) {
	try {
		if (this.concurrentExecutor instanceof ExecutorService) {
			return ((ExecutorService) this.concurrentExecutor).submit(task);
		}
		else {
			FutureTask<Object> future = new FutureTask<Object>(task, null);
			this.concurrentExecutor.execute(future);
			return future;
		}
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException(
				"Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:18,代码来源:TaskExecutorAdapter.java

示例4: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public Future<?> submit(Runnable task) {
	try {
		if (this.taskDecorator == null && this.concurrentExecutor instanceof ExecutorService) {
			return ((ExecutorService) this.concurrentExecutor).submit(task);
		}
		else {
			FutureTask<Object> future = new FutureTask<Object>(task, null);
			doExecute(this.concurrentExecutor, this.taskDecorator, future);
			return future;
		}
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException(
				"Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:txazo,项目名称:spring,代码行数:18,代码来源:TaskExecutorAdapter.java

示例5: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
public Future<?> submit(Runnable task) {
	try {
		if (this.concurrentExecutor instanceof ExecutorService) {
			return ((ExecutorService) this.concurrentExecutor).submit(task);
		}
		else {
			FutureTask<Object> future = new FutureTask<Object>(task, null);
			this.concurrentExecutor.execute(future);
			return future;
		}
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException(
				"Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:17,代码来源:TaskExecutorAdapter.java

示例6: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public Future<?> submit(Runnable task) {
	try {
		if (this.concurrentExecutor instanceof ExecutorService) { // 为"执行器服务"类实例
			return ((ExecutorService) this.concurrentExecutor).submit(task);
		}
		else { // 否则,使用一个"可取消的异步计算任务(FutureTask)"执行任务
			FutureTask<Object> future = new FutureTask<Object>(task, null);
			this.concurrentExecutor.execute(future);
			return future;
		}
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException(
				"Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:EdwardLee03,项目名称:spring-scheduling-sr,代码行数:18,代码来源:TaskExecutorAdapter.java

示例7: execute

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public void execute (Runnable task)
{
   Executor executor = getThreadPoolExecutor ();
   try
   {
      executor.execute (task);
   }
   catch (RejectedExecutionException ex)
   {
      throw new TaskRejectedException ("Executor [" + executor +
         "] did not accept task: " + task, ex);
   }
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:15,代码来源:FairThreadPoolTaskExecutor.java

示例8: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public Future<?> submit (Runnable task)
{
   ExecutorService executor = getThreadPoolExecutor ();
   try
   {
      return executor.submit (task);
   }
   catch (RejectedExecutionException ex)
   {
      throw new TaskRejectedException ("Executor [" + executor +
         "] did not accept task: " + task, ex);
   }
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:15,代码来源:FairThreadPoolTaskExecutor.java

示例9: execute

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public void execute(Runnable task) {
	Executor executor = getThreadPoolExecutor();
	try {
		executor.execute(task);
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ThreadPoolTaskExecutor.java

示例10: submit

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public Future<?> submit(Runnable task) {
	ExecutorService executor = getThreadPoolExecutor();
	try {
		return executor.submit(task);
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ThreadPoolTaskExecutor.java

示例11: submitListenable

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:ThreadPoolTaskExecutor.java

示例12: schedule

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) {
	try {
		if (this.enterpriseConcurrentScheduler) {
			return new EnterpriseConcurrentTriggerScheduler().schedule(decorateTask(task, true), trigger);
		}
		else {
			ErrorHandler errorHandler = (this.errorHandler != null ? this.errorHandler : TaskUtils.getDefaultErrorHandler(true));
			return new ReschedulingRunnable(task, trigger, this.scheduledExecutor, errorHandler).schedule();
		}
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:ConcurrentTaskScheduler.java

示例13: scheduleAtFixedRate

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period) {
	long initialDelay = startTime.getTime() - System.currentTimeMillis();
	try {
		return this.scheduledExecutor.scheduleAtFixedRate(decorateTask(task, true), initialDelay, period, TimeUnit.MILLISECONDS);
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ConcurrentTaskScheduler.java

示例14: scheduleWithFixedDelay

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) {
	long initialDelay = startTime.getTime() - System.currentTimeMillis();
	try {
		return this.scheduledExecutor.scheduleWithFixedDelay(decorateTask(task, true), initialDelay, delay, TimeUnit.MILLISECONDS);
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ConcurrentTaskScheduler.java

示例15: execute

import org.springframework.core.task.TaskRejectedException; //导入依赖的package包/类
@Override
public void execute(Runnable task) {
	Executor executor = getScheduledExecutor();
	try {
		executor.execute(errorHandlingTask(task, false));
	}
	catch (RejectedExecutionException ex) {
		throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ThreadPoolTaskScheduler.java


注:本文中的org.springframework.core.task.TaskRejectedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。