com.codingapi.tx.framework.task.TaskGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tx-client Show documentation
Show all versions of tx-client Show documentation
tx-client project for Spring Boot
package com.codingapi.tx.framework.task;
import java.util.ArrayList;
import java.util.List;
/**
* create by lorne on 2017/8/22
*/
public class TaskGroup {
private String key;
private List tasks;
private TxTask current;
private int state;
public TxTask getCurrent() {
return current;
}
public void setCurrent(TxTask current) {
this.current = current;
}
public String getKey() {
return key;
}
public TaskGroup() {
tasks = new ArrayList<>();
}
public void setKey(String key) {
this.key = key;
}
public List getTasks() {
return tasks;
}
public void addTask(TxTask task) {
tasks.add(task);
}
public boolean isAwait(){
for(TxTask task: getTasks()){
if(!task.isAwait()){
return false;
}
}
return true;
}
public boolean isRemove(){
for(TxTask task: getTasks()){
if(!task.isRemove()){
return false;
}
}
return true;
}
public void signalTask(){
for(TxTask task: getTasks()){
task.setState(state);
task.signalTask();
}
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy