// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.concurrent.Callable;

public interface ErSoQueue {
    public static class Work implements Callable<Result>{
        // dummy implementation
        @Override
        public Result call() throws Exception {
            Thread.sleep(1000);
            return new Result(true);
        }
    }
    public static class Result {
        // dummy implementation
        private boolean status;
        public Result(boolean status) {
            this.status = status;
        }
        public boolean isStatus() {
            return status;
        }
    }
    public static class ErSoException extends Exception {
        private static final long serialVersionUID = 1L;
        public ErSoException(String msg) {
            super(msg);
        }
        public ErSoException(Exception ex) {
            super(ex);
        }
    }
    public void submitWork(Work w);
    public Result getResult() throws ErSoException;
    public void stop(boolean wait);
}
