1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.yiidata.intergration.web.task;
- /**
- *
- * Spark 任务并发控制,控制总超类
- *
- * <pre>
- *
- * Created by zhaopx.
- * User: zhaopx
- * Date: 2020/11/17
- * Time: 11:11
- *
- * </pre>
- *
- * @author zhaopx
- */
- public abstract class SuperTask implements Runnable {
- final String taskId;
- public SuperTask(String taskId) {
- this.taskId = taskId;
- }
- /**
- * 获取前端 TASKID
- *
- * @return
- */
- public final String getTaskId() {
- return taskId;
- }
- /**
- * 执行任务
- */
- @Override
- public final void run() {
- try {
- doExecute();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- /**
- * 执行任务
- * @throws Exception
- */
- public abstract void doExecute() throws Exception;
- }
|