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

cn.schoolwow.data.thread.work.AbstractDataThreadWork Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package cn.schoolwow.data.thread.work;

import cn.schoolwow.data.thread.listener.ProgressListener;
import cn.schoolwow.quickflow.QuickFlow;

public abstract class AbstractDataThreadWork> implements DataThreadWork{
    protected QuickFlow workFlow = QuickFlow.newInstance();

    public AbstractDataThreadWork(String name){
        workFlow.putContextData("name", name);
    }

    /**监听进度*/
    public T progressListener(ProgressListener progressListener) {
        workFlow.putContextData("workProgressListener", progressListener);
        return self();
    }

    /**线程个数*/
    public T threadCount(int threadCount) {
        workFlow.putContextData("workThreadCount", threadCount);
        return self();
    }

    /**是否等待线程执行完毕*/
    public T waitFor(boolean waitFor) {
        workFlow.putContextData("workWaitFor", waitFor);
        return self();
    }

    public QuickFlow getWorkFlow(){
        return workFlow;
    }

    protected abstract T self();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy