/** * Execute a task in its own thread. * @param task The task to execute. */ public synchronized void execute(Runnable task) { // if(!isValid()) // throw new RuntimeException("Service invalid: "+this); threadpool.execute(task); }
/** * Shutdown the service. * @param listener The listener. */ public synchronized IFuture<Void> shutdownService() { threadpool.dispose(); return super.shutdownService(); }
/** * Test if the thread pool is running. */ public boolean isRunning() { return threadpool.isRunning(); }
threadpool.addFinishListener(new IChangeListener<Void>() threadpool.dispose(); return ret;
/** * Add a finished listener. */ public void addFinishListener(IChangeListener<Void> listener) { threadpool.addFinishListener(listener); } }
/** * Execute a task in its own thread. * @param task The task to execute. */ public synchronized void execute(Runnable task) { // if(!isValid()) // throw new RuntimeException("Service invalid: "+this); threadpool.execute(task); }
/** * Test if the thread pool is running. */ public boolean isRunning() { return threadpool.isRunning(); } }
/** * Shutdown the service. * @param listener The listener. */ public synchronized IFuture<Void> shutdownService() { threadpool.dispose(); return super.shutdownService(); }
/** * Execute a task in its own thread. * @param task The task to execute. */ public synchronized void execute(Runnable task) { // if(!isValid()) // throw new RuntimeException("Service invalid: "+this); threadpool.execute(task); }
try while(tp.isRunning() && !closed)
threadpool.execute(this);
/** * Create a new combined input stream. * @param in1 The first input stream. * @param outin The second stream that can be used to write * data that is pumped as input to the input stream. * @throws IOException if streams cannot be opened. */ public CombinedInputStream(final InputStream in1, final InputStream in2, IThreadPool tp) throws IOException { this.in1 = in1; this.in2 = in2; this.out = new PipedOutputStream(); connect(out); if(tp!=null) { tp.execute(new Reader(in1, out)); tp.execute(new Reader(in2, out)); } else { Thread t1 = new Thread(new Reader(in1, out)); Thread t2 = new Thread(new Reader(in2, out)); t1.start(); t2.start(); } }
tp.execute(tasks[num]);
if(tp!=null) tp.execute(run);
final IExternalAccess ea = agent.getExternalAccess(); tp.execute(new Runnable()
threadpool.execute(task);
status.setText("searching '"+exp+"'"); getThreadPool().execute(new Runnable()
getCombo().getThreadPool().execute(new Runnable()