package jetbrains.mps.make.script;
/*Generated by MPS */
import jetbrains.mps.make.MakeSession;
import org.jetbrains.annotations.NotNull;
public interface IJobMonitor {
boolean stopRequested();
/**
* Progress monitor is passed as a method parameter
*
* @return dummy IProgress
*/
@Deprecated
IProgress currentProgress();
void reportFeedback(IFeedback fdbk);
/**
*
*
* @since 2017.2
* @return active session, never {@code null}
*/
MakeSession getSession();
class Stub implements IJobMonitor {
private final IProgress pstub;
private final MakeSession mySession;
public Stub(IProgress pstub) {
this.pstub = pstub;
mySession = null;
}
public Stub() {
this.pstub = new IProgress.Stub();
mySession = null;
}
public Stub(@NotNull MakeSession makeSession) {
this.pstub = new IProgress.Stub();
mySession = makeSession;
}
@Override
public IProgress currentProgress() {
return pstub;
}
@Override
public void reportFeedback(IFeedback fdbk) {
}
@Override
public boolean stopRequested() {
return false;
}
@Override
public MakeSession getSession() {
if (mySession == null) {
throw new IllegalStateException("Override the method if you use custom IJobMonitor implementation");
}
return mySession;
}
}
}