xapi.process.api.ProcessCursor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xapi-core-process Show documentation
Show all versions of xapi-core-process Show documentation
The basic interfaces and services of the concurrency service.
package xapi.process.api;
import java.io.Serializable;
import java.util.Iterator;
import xapi.inject.impl.LazyPojo;
import static xapi.util.X_Util.equal;
/**
* A state-blob for creating a resumable operation, most often sent to you by an
* exception, or thrown by you via a RescheduleException.
*
* @author "James X. Nelson ([email protected])"
*/
public class ProcessCursor {
private transient Iterable stages;
private final LazyPojo> path;
public ProcessCursor(Iterable path, int size) {
this.stages = path;
this.path = new LazyPojo>() {
@Override
protected java.util.Iterator initialValue() {
if (stages == null) {
}
return stages.iterator();
};
};
}
K[] done;
K[] todo;
int position;
int maxTries = 3;
int tries = 1;
public void bump() {
}
public boolean ifNext(K position) {
if (equal(todo[this.position], position)) {
bump();
return true;
}
return false;
}
public void skip(K position) {
}
@Override
protected void finalize() throws Throwable {
stages = null;
path.reset();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy