1 19 20 package org.netbeans.core.execution; 21 22 import org.openide.execution.ExecutorTask; 23 import org.openide.windows.InputOutput; 24 25 30 final class ExecutorTaskImpl extends ExecutorTask { 31 32 int result = -1; 33 34 DefaultSysProcess proc; 35 36 Object lock = this; 37 38 39 ExecutorTaskImpl() { 40 super(new Runnable () { 41 public void run() {} 42 } 43 ); 44 } 45 46 47 public void stop() { 48 try { 49 synchronized (lock) { 50 while (proc == null) lock.wait(); 51 proc.stop(); 52 } 53 } catch (InterruptedException e) { 54 } 55 } 56 57 public int result() { 58 waitFinished(); 59 return result; 60 } 61 final void finished() { 63 notifyFinished(); 64 } 65 public void run() { 66 waitFinished(); 67 } 68 69 public InputOutput getInputOutput() { 70 return proc.getInputOutput(); 71 } 72 } 73 | Popular Tags |