com.yoloho.schedule.extension.task.AbstractRedisQueueSingleTask Maven / Gradle / Ivy
The newest version!
package com.yoloho.schedule.extension.task;
import java.util.Comparator;
import java.util.List;
import com.yoloho.schedule.interfaces.IScheduleTaskDealSingle;
import com.yoloho.schedule.types.TaskItem;
/**
* 任务的抽象类,提供以redis为队列的简单抽象
*
* @author jason
*
*/
public abstract class AbstractRedisQueueSingleTask extends AbstractRedisQueueTask
implements IScheduleTaskDealSingle {
@Override
public List selectTasks(String taskParameter, String ownSign, int taskItemNum, List taskItemList,
int eachFetchDataNum) throws Exception {
return getTaskList(eachFetchDataNum);
}
protected abstract boolean processItem(T item);
@Override
public boolean execute(T item, String ownSign) throws Exception {
return processItem(item);
}
@Override
public Comparator getComparator() {
return null;
}
}