All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.download.module.task.PriorityThread Maven / Gradle / Ivy

The newest version!
package cn.schoolwow.download.module.task;

import cn.schoolwow.download.domain.task.DownloadTask;
import cn.schoolwow.download.module.task.flow.fail.DownloadFailFlow;
import cn.schoolwow.download.module.task.flow.finish.DownloadFinishFlow;
import cn.schoolwow.download.module.task.service.StartDownloadCompositeBusiness;
import cn.schoolwow.quickflow.domain.FlowContext;

import java.io.File;
import java.util.concurrent.Callable;

/**
 * 优先级下载线程
 * */
public class PriorityThread implements Callable, Comparable{
    private DownloadTask downloadTask;
    private FlowContext flowContext;

    public PriorityThread(FlowContext flowContext) {
        this.downloadTask = flowContext.checkInstanceData(DownloadTask.class);
        this.flowContext = flowContext;
    }

    @Override
    public int compareTo(PriorityThread o) {
        if(downloadTask.priority>o.downloadTask.priority){
            return 1;
        }else if(downloadTask.priority




© 2015 - 2025 Weber Informatics LLC | Privacy Policy