com.ruoyi.common.utils.Threads Java Examples

The following examples show how to use com.ruoyi.common.utils.Threads. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringSessionValidationScheduler.java    From supplierShop with MIT License 5 votes vote down vote up
@Override
public void disableSessionValidation()
{
    if (log.isDebugEnabled())
    {
        log.debug("Stopping Spring Scheduler session validation job...");
    }

    if (this.enabled)
    {
        Threads.shutdownAndAwaitTermination(executorService);
    }
    this.enabled = false;
}
 
Example #2
Source File: ThreadPoolConfig.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 执行周期性或定时任务
 */
@Bean(name = "scheduledExecutorService")
protected ScheduledExecutorService scheduledExecutorService()
{
    return new ScheduledThreadPoolExecutor(corePoolSize,
            new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
    {
        @Override
        protected void afterExecute(Runnable r, Throwable t)
        {
            super.afterExecute(r, t);
            Threads.printException(r, t);
        }
    };
}
 
Example #3
Source File: ThreadPoolConfig.java    From RuoYi-Vue with MIT License 5 votes vote down vote up
/**
 * 执行周期性或定时任务
 */
@Bean(name = "scheduledExecutorService")
protected ScheduledExecutorService scheduledExecutorService()
{
    return new ScheduledThreadPoolExecutor(corePoolSize,
            new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
    {
        @Override
        protected void afterExecute(Runnable r, Throwable t)
        {
            super.afterExecute(r, t);
            Threads.printException(r, t);
        }
    };
}
 
Example #4
Source File: SpringSessionValidationScheduler.java    From ruoyiplus with MIT License 5 votes vote down vote up
@Override
public void disableSessionValidation()
{
    if (log.isDebugEnabled())
    {
        log.debug("Stopping Spring Scheduler session validation job...");
    }

    if (this.enabled)
    {
        Threads.shutdownAndAwaitTermination(executorService);
    }
    this.enabled = false;
}
 
Example #5
Source File: ThreadPoolConfig.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Bean(name = "scheduledExecutorService")
protected ScheduledExecutorService scheduleTaskExuctor() {
    return new ScheduledThreadPoolExecutor(corePoolSize,
            new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()){
        @Override
        protected void afterExecute(Runnable r, Throwable t){
            super.afterExecute(r, t);
            Threads.printException(r, t);
        }
    };
}
 
Example #6
Source File: AsyncManager.java    From supplierShop with MIT License 4 votes vote down vote up
/**
 * 停止任务线程池
 */
public void shutdown()
{
    Threads.shutdownAndAwaitTermination(executor);
}
 
Example #7
Source File: AsyncManager.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
/**
 * 停止任务线程池
 */
public void shutdown()
{
    Threads.shutdownAndAwaitTermination(executor);
}
 
Example #8
Source File: AsyncManager.java    From ruoyiplus with MIT License 4 votes vote down vote up
/**
 * 停止任务线程池
 */
public void shutdown()
{
    Threads.shutdownAndAwaitTermination(executor);
}