public class TermShortestPath extends ShortestPath { TermDetector td = null; public TermShortestPath(Linker initComm, int initCost[], TermDetector td) { super(initComm, initCost); this.td = td; } public void initiate() { super.initiate(); td.initiate(); } public void sendMsg(int dest, String tag, int msg) { super.sendMsg(dest, tag, msg); td.sendAction(); } public synchronized void handleMsg(Message m, int source, String tag) { td.handleMsg(m, source, tag); super.handleMsg(m, source, tag); td.turnPassive(); } }