1 package edu.berkeley.fleet.api;
6 * Represents a <i>running</i> "slave" fleet with debugging
7 * facilities controlled by the "master" JVM.
9 * <p>Each Fleet which supports this API must include:
10 * <ul><li> The ability to dispatch instructions from the master, "on
12 * <li> A "debug.in" dock such that any words delivered there
13 * are sent back to the master.
16 public abstract class FleetProcess {
18 private boolean terminated = false;
20 /** dispatch an instruction */
21 public abstract void dispatchInstruction(Instruction i);
23 /** the dock used to read back data from the slave */
24 public abstract Dock getDebugInputDock();
26 /** returns the next word delivered at the dock specified by <tt>getDebugInputDock()</tt> */
27 public abstract BitVector readWord();
29 /** Terminate the process; subclasses may be assured that this will be called exactly once. */
30 protected abstract void _terminate();
32 public final synchronized void terminate() {
33 if (terminated) return;
38 public final boolean isTerminated() { return terminated; }
39 public synchronized void finalize() { terminate(); }