Search in sources :

Example 1 with ExpressionJobExecuteCallable

use of com.netsteadfast.greenstep.support.ExpressionJobExecuteCallable in project bamboobsc by billchen198318.

the class SystemExpressionJobUtils method executeJobs.

public static void executeJobs() throws ServiceException, Exception {
    List<ExpressionJobObj> jobObjList = getExpressionJobs();
    if (jobObjList == null || jobObjList.size() < 1) {
        return;
    }
    ExecutorService exprJobPool = Executors.newFixedThreadPool(SimpleUtils.getAvailableProcessors(jobObjList.size()));
    for (ExpressionJobObj jobObj : jobObjList) {
        jobObj = exprJobPool.submit(new ExpressionJobExecuteCallable(jobObj)).get();
    }
    exprJobPool.shutdown();
}
Also used : ExpressionJobExecuteCallable(com.netsteadfast.greenstep.support.ExpressionJobExecuteCallable) ExecutorService(java.util.concurrent.ExecutorService) ExpressionJobObj(com.netsteadfast.greenstep.model.ExpressionJobObj)

Example 2 with ExpressionJobExecuteCallable

use of com.netsteadfast.greenstep.support.ExpressionJobExecuteCallable in project bamboobsc by billchen198318.

the class SystemExpressionJobUtils method executeJobForManual.

public static SysExprJobLogVO executeJobForManual(String expressionJobOid) throws ServiceException, Exception {
    ExpressionJobObj jobObj = getExpressionJobForManualMode(expressionJobOid);
    ExecutorService exprJobPool = Executors.newFixedThreadPool(1);
    jobObj = exprJobPool.submit(new ExpressionJobExecuteCallable(jobObj)).get();
    exprJobPool.shutdown();
    return jobObj.getSysExprJobLog();
}
Also used : ExpressionJobExecuteCallable(com.netsteadfast.greenstep.support.ExpressionJobExecuteCallable) ExecutorService(java.util.concurrent.ExecutorService) ExpressionJobObj(com.netsteadfast.greenstep.model.ExpressionJobObj)

Aggregations

ExpressionJobObj (com.netsteadfast.greenstep.model.ExpressionJobObj)2 ExpressionJobExecuteCallable (com.netsteadfast.greenstep.support.ExpressionJobExecuteCallable)2 ExecutorService (java.util.concurrent.ExecutorService)2